Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
UTF-8 file creation
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01478595
Message ID:
01478709
Vues:
121
This message has been marked as the solution to the initial question of the thread.
Nicholas,

There are two components to make a file UTF-8:

* The actual content has to be UTF-8 encode (STRCONV(txt,9))
* The file has to have a byte order mark

The BOM is a value that preceeds the file content and it's a hint for any editor/file reader to detect the encoding of the file. If the BOM is missing many tools will open the file as locale-default ANSI text.

The UTF-8 prefix is:



The easiest way to get the BOM into the document is to generate your string then use STRTOFILE(utf8EncodedContent,file,4). The last parameter writes the UTF-8 BOM for you. Note that the encoding parameters are new in VFP 9 I believe...

Hope this helps,

+++ Rick ---


>HI
>
>I'm creating a file using FCREATE etc .
>
>The files contents are some XML
>
>The recipient wants it in UTF-8 format.
>
>how do I ensure that the file I create is in that format .
>
>Nick
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform