Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving unicode data
Message
 
 
À
28/12/2011 09:07:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01531693
Message ID:
01531782
Vues:
50
>>>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.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform