Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Character Sets
Message
De
11/09/2014 06:36:23
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01607355
Message ID:
01607382
Vues:
60
>>>>Hi All
>>>>
>>>>I am receiving text (TXT) files from a 3rd party entity. I read the file in using FILETOSTR(), amend it, and then write it out to another TXT file using STRTOFILE(). Someone has now asked me what character set we are using for the output file. How do I find that out or answer this question?
>>>>
>>>>TIA
>>>
>>>STRTOFILE() generates pure TXT and uses that charset what is set in Control Panel->Region and Language->Administrative->Current Language for non-Unicode programs.
>>>In most cases it is Windows-1252 (in my case it is Windows-1251).
>>>
>>>That is true if you didn't use STRCONV() or API function to convert the chars.
>>
>>Nope. If any codepage translation it's done at input (keyboard) level. StrToFile() just writes the bytes as they come.
>>It does not generate text files.
>>
>>lcx =filetostr(HOME()+'VFP9.exe')
>>STRTOFILE(lcx,GETENV("TEMP")+'\VFP9.exe')
>>
>>creates a copy of VFP.9 exe
>>
>>Lutz
>
>
>What about this this:
>
>TEXT TO lcTXT NOSHOW
>   Some text that shoulbe 
>written in pure text file
>ENDTEXT
>STRTOFILE(lcTXT,"Test.TXT")
>
I agree that this will create a text file. But this only by the definition of
-the data you put in
-the format (extension) you use to propagate this data.

The bytes that will go into the file will depend on the codepage of the system (or if you play with the fpw file) (At least I think that literals will not follow the codepage the compiler runs into, and I'm to lazy to check). We agree that some conversion will happen, at least.
But for the OP VFP will not change / transform the bytes of a file read, except if coded that way.0

In my eys the question is wrong. A common text file has no codepage. No way to store it. It holds bytes that belong to some codepage - but this is a different problem.
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform