Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Saving unicode data
Message
 
 
To
28/12/2011 09:25:47
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01531693
Message ID:
01531791
Views:
45
>>>>>So, it's very simple
>>>>>
>>>>>
>>>>>(1) the msforms accepts UTF-16
>>>>
>>>>If I get the value from SQL Server, I don't get the string above. I get a 4 bytes per character string. You missed the step of retrieving the value from SQL Server.
>>>
>>>Look, I just copied your code to fill the cursor - and it's 2 bytes/char
>>>
>>>
>>>>>(2) And gives its value back in the 'current' code page - which is a bad conversion
>>>>>(3) swith to the code page of the language you're displaying with sys(3101)
>>>>
>>>>!!!!!!!!!!!!! But I don't know which language I am displaying - that's the whole point!
>>>
>>>Well, you'll need to know the language - how else can you know the codepage ?
>>>
>>>
>>>>
>>>>>(4) retrieve the value
>>>>>(5) set the original value of sys(3101) back
>>>>>(6) convert the value to utf-16
>>>>
>>>>Ok, I'll try.
>>>>
>>>>Although two extra steps are missing in your tests:
>>>>
>>>>1. Retrieve data from nvarchar(100) field
>>>
>>>That is the cursor
>>>
>>>>
>>>>5. Save data back to nvarchar(100) field
>>>
>>>Well, I have the data in a string - you can add an undate or a replace ?
>>>
>>>
>>>>6. Try with different languages (don't know in advance which) and all different languages need to show correctly on the same form.
>>>
>>>
>>>I have shown an example in Cyrillic - surely you can try a few others
>>
>>Gregory,
>>
>>The form I am developing is for specifying languages we're going to use in the interface. I can not know in advance which languages the user is going to pick. So, I want to develop a universal form where the user can specify any language and type in that language. Which particular language they pick I don't know in advance.
>>
>>Also, the SQL Server does add an extra complexity, so I ask you to please try the whole thing (from retrival to saving) if possible, of course. And assume you don't know the CodePage in advance.
>
>
>Give me the russian data you have retrieved from sqlserver (create cursor and insert). I cannot and willl not go any further than that -

Not sure if my last reply was helpful (with the exact value I got from SQL Server), but attached is the picture of what I see. The messagebox displays the text value of the first textbox (I set the comprop UTF8 to 1).

And the Chineese is supposed to be also Russian.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform