Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Thai characters in VFP9 display incorrectly
Message
From
06/03/2007 13:54:23
Denis Filer
University of Oxford
United Kingdom
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01200084
Message ID:
01201157
Views:
39
This message has been marked as the solution to the initial question of the thread.
Mathias and Dragan, first thank you both for comments. I have resolved this issue with help from both of you. My PC was set to Thai (Regional/Language options, Advanced settings for non-unicode). The issue was that the Arial font was not supported by the Thai script as in FontCharSet. Changing to MS Sans Serif was the first part to resolve this. However, there was another problem that dogged me. I have a grid class where the textbox members are replaced programmatically by my own textbox class. The grid and textbox fonts were set to MS Sans Serif. But what I had not realised was that the column parents of my textboxes also had to be programmatically set to the same fontname - they were defaulting to Arial. Before I discovered this, the Thai characters appeared OK when the text boxes had focus but went wonky when the lost it. It's working fine now. Interestingly, Chinese characters appeared OK in Arial - this helped to throw me I guess. Many thanks, Denis



Denis,

You probably have resolved this but pardon me, I am keen to know if there was something different about setup with the Chinese chars where you say it worked fine. Was it on the same machine? OS etc? The reason am asking is am wondering if when your class references the os directly for code page info?

Mathias

>Mathias, Thanks for this advice. I think my system is as Thai as I can make it. CPCURRENT(1) and (2) return 874 before and after entry to the app. The test DBF has this codepage. Adding a browse command to display the DBF shows the characters correctly UNTIL a class to display the data in a grid on a form is launched. This grid includes a textbox subclass. As soon as this is launched, the characters go wrong even using a basic BROWSE. There's nothing I can see in the class that seems to me to change code pages. Puzzling to say the least. Thanks again, Denis
>
>
>
>
>Denis,
>
>Check the system code page before launching your app. Then check it again while your app is running. If it's changed, then foxpro is translating the 874-Thai in your table to whatever the system code page is for display purposes.
>
>Regards
>
>Mathias
>
>>I have installed the Thai language as prompted by XP and set my PC to the Thai language for non-unicode prgs, re-booted. When I browse a DBF direct in VFP 9 and paste in Thai characters from a Thai excel file, this displays OK. But open the same DBF file in my VFP 9 application, and they get scrambled. The code page of the DBF is 874-Thai (does this actually matter?). I've tried config.fpw empty and with various entries for set codepage altho not sure what is best there. Anyone out there understand the MS instructions for this? Interestingly, I did this recently with Chinese characters and it all worked well. Thanks, Denis
Previous
Reply
Map
View

Click here to load this message in the networking platform