Hi Robert.
Almost correct, but bbkunde.dbf is encoded in DE850 not DEWIN.
Code: Select all
#include "hmg.ch"
PROCEDURE Main
local cLine
request HB_CODEPAGE_DE850
request HB_CODEPAGE_DEWIN
//request HB_CODEPAGE_DEISO
//set( _SET_CODEPAGE, "DE850" )
set( _SET_CODEPAGE, "DEWIN" )
//set( _SET_CODEPAGE, "DEISO" )
set alternate to ("KDS.txt")
set alternate on
//bbkunde.dbf is encoded in DE850, not DEWIN
use bbkunde alias kunde new codepage("DE850")
astruct:={{"NAME","C",30,0}}
dbcreate("FILE",astruct,"dbfntx")
use FILE alias FILE new exclusive
DEFINE WINDOW Servisa ;
AT 120,120 ;
WIDTH 800 ;
HEIGHT 800 ;
ON INIT ahead() ;
FONTNAME 'ARIAL' FONTSIZE 12;
TITLE "DATA" ;
MAIN
END WINDOW
Servisa.center
ACTIVATE WINDOW Servisa
RETURN NIL
procedure ahead
//set console off
select kunde
do while !eof()
cLine=name
? cLine
select file
dbappend()
replace name with kunde->name
select kunde
skip
enddo
J
MsgInfo('END. File.dbf and KDS.txt are encoded in DEWIN')
close data
msgbox('Test CP DE850 of bbkunde.dbf')
use bbkunde alias kunde new codepage("DE850")
edit extended
use
msgbox('Test CP DEWIN of bbkunde.dbf')
use bbkunde alias kunde new
edit extended
use
msgbox('Test CP DE850 of file.dbf')
use file alias file new codepage("DE850")
edit extended
use
msgbox('Test CP DEWIN of file.dbf')
use file alias file new
edit extended
use
servisa.release
RETURN
It seems to me that Excel defaults to opening dbf files in the code page of the console, i.e. the German version of Windows will be 850 and the Polish version will be 852
In openoffice, you can probably choose the code page in which to open the dbf file.
I quickly check coding using file preview in Total Commander.
Edward.