Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Working with Russian text in VFP
Message
De
10/04/2006 13:12:02
 
 
À
10/04/2006 12:42:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Divers
Thread ID:
01110111
Message ID:
01112075
Vues:
241
This message has been marked as the solution to the initial question of the thread.
You have some mistakes in this code:
lcUtf8 = filetostr( 'russian_utf8.txt' )
* lcRussian = strconv( lcUtf8, 9, 1251, 1 ) <- this is wrong
lcRussian = strconv( lcUtf8, 11, 1251, 1 ) &&Works OK for me
strtofile( lcRussian, 'russian.txt' )
modify file russian.txt as 1251 &&I see normal russian text

lcUnicode = filetostr( 'russian_unicode.txt' )
* lcRussian = strconv( lcUtf8, 6, 1251, 1 ) <- why lcUtf8 ???
*** Hey, man! Use CORRECT variable!!!
lcRussian = strconv( lcUnicode, 6, 1251, 1 )
strtofile( lcRussian, 'russian.txt' )

modify file russian.txt as 1251 &&I see normal russian text again
Something you can also add is to remove first 2 bytes from UTF-8 and Unicode texts. AFAIK they are some kind of header, not a character. So, the first character in lcRussian is stupid question mark in both cases.
/A new technology turns into completely outdated stuff before you have a time to read "Getting Started..." section.
/If there are some "system programmers" then others are unsystematic.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform