Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to convert a text file to utf-8
Message
From
04/11/2011 11:19:20
Reza Meamar
Homa Programming Group
Shiraz, Iran
 
 
To
04/11/2011 11:12:06
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01528059
Message ID:
01528068
Views:
56
>>>>>Check the Strconv() function in Help.
>>>>>
>>>>>>Dear All,
>>>>>>I want to Convert a Text File to UTF-8 similar to below steps, but with vfp commands. How can i do this?
>>>>>>
>>>>>>1 ) Open Notepad.
>>>>>>2 ) Click "File," "Open." Select the text file you want to convert. Click "Open."
>>>>>>3 ) Open the "File" menu again. Select "Save As." Enter your preferred file name.
>>>>>>4 ) Choose "UTF-8" from the drop-down menu beside "Encoding." Click "Save."
>>>>>>
>>>>>>thanks
>>>>
>>>>NO, I check this function. i want to change my text file that created with TEXT ... ENDTEXT and is in ANSII mode to UTF-8 as said above.
>>>
>>>Please reread my message and Help, you will realize that I gave you the answer you were looking for. A combination on Filetostr(), Strtofile() and Strconv() should be enough.
>>>
>>>Also you need to realize that VFP has very limited support for double byte text files.
>>
>>Dear Tore,
>>this is one line from my txt file.( it is a xml file)
>>
>><FORM_ADS BA="1" BB="103" BC="471790275" BD="" BE="1" BF="13900808" BG="2292154625" BH="86903" BI="ȝխ⠁珢 BJ="ӥ҇" BK="" >
>>
>>the content of BI and BJ is in wrong condition.
>>i test STRCONV() to correct this, but i can not.
>>below line is my file when i open it in notepad and save as it as UTF-8 encoding.
>>BI and BJ content is show correctly as i want.
>>
>><FORM_ADS BA="1" BB="103" BC="471790275" BD="" BE="1" BF="13900808" BG="2292154625" BH="86903" BI="افشين پور" BJ="زهرا" BK="" >
>>
>
>Unfortunately I can't be of more help to you.

Thank you Tore,
I am using from STRCONV() on my field content, but i must use from it on my file.
I change my program to
= STRTOFILE(STRCONV(FILETOSTR("C:\ XmlFName.txt"),9),("C:\utf8text.txt"))
and it work as i want.
thanks for force me to read help carefully.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform