Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Codepage/character translation
Message
From
06/09/2001 14:20:19
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
06/09/2001 13:04:45
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00553240
Message ID:
00553313
Views:
13
>We are trying to query a customer's remote FP2.6DOS database but we're having some character translation problems. Our applicaiton is written in Java, and we're using a JDBC/ODBC bridge to query the FP database. The JDBC driver resides on the customer's server.
>
>The application which populates the database creates a hexadecimal value which is stores into a text field. When we do the joins within FoxPro everything works great. When we store the primary key for use in subsequent queries, the joins do not work.
>
>The reason they don't work is the characters in the key fields don't match up with characters on our machines. It's like FoxPro is using an antiquated codepage for its character set, and when we store the value it takes its best guess as to what the characters are.
>
>The same thing happens when I copy the FP2.6DOS database to my harddrive and link/import using MSAccess. As soon as those fields are outside of FP2.6DOS the character translations are corrupted.
>
>Does anyone have any idea how we read a FP2.6DOS database and retain the key fields in their original character set so our subsequent queries work?

You're facing two questions here: one is to see whether the codepage information is present in the 2.6 tables (check with cpdbf()). If the codepage is wrong, you can fix it using cpzero.prg, supplied in all versions of fox since 2.6 - it should be home()+'tools\cpzero\cpzero.prg'.

Once the codepage mark is in place (it's only a value in 28th byte of the dbf's header - see cpzero.prg for the list of values), you come to the next question - is the software you're using to read these tables aware of the codepages at all? I've seen only a few, and even then I haven't seen them doing too good a job; even Excel, while it still had Fox tables as an option for export, exported Eastern European into codepage 852 (DOS) instead of 1250 (Windows). Just tried one, and the codepage there turned out to be absent (well, had to use dBase V format which is still available), and the character set used was really strange - couldn't get it to fit and show proper characters.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform