Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code page
Message
From
20/05/1998 06:59:24
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
19/05/1998 16:09:37
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00082646
Message ID:
00100479
Views:
32
>>>Hi, I'm writing from Hungary and I have a small problem with the code page settings. As I know the eastern europian code Windows page is 1250. But when the VFP starts and I check the project files code pages, it shows 1252 for the DBC. So, how can I change the DBC or only the DBF code page settings to 1250?
>>>
>>>Thanks!
>>>
>>>IVAN
>>You can use "cpzero.prg" to do it or change byte 29 in header manually.
>>Cetin
>---
>hi Certin
>When I run my EXE it is asking for the Code Page. I pick WINDOWS and ANSI and the program runs OK. My users are not going to like this extra step. When the program runs the second time, it does not ask for the Code Page. How can I set the Code page in the program code?
>thanks
>rob
Rob,
Basic idea is to open the table lowlevel and poke needed value to byte offsett 29. Once poked VFP doesn't ask again. Either write your own poke routine or use cpzero.prg in home()+"tools\cpzero".
* Your simple version
function cppoker
lparameters cTableName, nCodepage
DIMENSION cpnums[22,2] 
cpnums[ 1,1] = 437
cpnums[ 1,2] = 1
cpnums[ 2,1] = 850
cpnums[ 2,2] = 2
cpnums[ 3,1] = 1252
cpnums[ 3,2] = 3
cpnums[ 4,1] = 10000
cpnums[ 4,2] = 4
cpnums[ 5,1] = 852
cpnums[ 5,2] = 100
cpnums[ 6,1] = 866
cpnums[ 6,2] = 101
cpnums[ 7,1] = 865
cpnums[ 7,2] = 102
cpnums[ 8,1] = 861
cpnums[ 8,2] = 103
cpnums[ 9,1] = 895
cpnums[ 9,2] = 104
cpnums[10,1] = 620
cpnums[10,2] = 105
cpnums[11,1] = 737
cpnums[11,2] = 106
cpnums[12,1] = 857
cpnums[12,2] = 107
cpnums[13,1] = 863
cpnums[13,2] = 108
cpnums[14,1] = 10007
cpnums[14,2] = 150
cpnums[15,1] = 10029
cpnums[15,2] = 151
cpnums[16,1] = 10006
cpnums[16,2] = 152
cpnums[17,1] = 1250
cpnums[17,2] = 200
cpnums[18,1] = 1251
cpnums[18,2] = 201
cpnums[19,1] = 1253
cpnums[19,2] = 203
cpnums[20,1] = 1254
cpnums[20,2] = 202
cpnums[21,1] = 1257
cpnums[21,2] = 204
cpnums[22,1] = 0
cpnums[22,2] = 0
cTableName = cTableName + ;
         iif(atc(".dbf",cTableName)=0,".dbf","")
FOR ix = 1 TO 22
   IF nCodepage = cpnums[ix,1]
         handle = fopen(cTableName,2)
         =FSEEK(handle,29)
         =FWRITE(handle,CHR(cpnums[ix,2])) 
         =FCLOSE(handle)
         EXIT
   ENDIF
ENDFOR
Pls note that this requires exclusive access. You could add this routine to your table+DBC creator.prg or if data is sent ready via setup wizard, run once before delivery.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform