Convertit une chaîne ou un buffer vers le format spécifié : UTF, Ansi, Unicode.
Remarque : Cette fonction gère les formats UTF8, UTF16 Little Endian, UTF16 Big Endian et UTF32.
// Conversion chaîne ANSI en un buffer UTF32
MaChaîneAnsi est une chaîne ANSI = "début"
MonBuffer est un Buffer = UTFConvertit(MaChaîneAnsi, alphabetCourant, alphabetUTF32)
Syntaxe
<Résultat> = UTFConvertit(<Chaîne ou buffer à convertir> , <Alphabet d'origine> , <Alphabet destination>)
<Résultat> : Chaîne de caractères ou Buffer
Résultat de la conversion : - Chaîne UNICODE si l'alphabet destination correspond à la constante alphabetUnicode.
- Chaîne ANSI ou buffer dans le cas contraire.
- Chaîne vide ("") en cas de problème de conversion. La variable ErreurDétectée vaut Vrai et le message d'erreur correspondant peut être connu avec la fonction ErreurInfo.
<Chaîne ou buffer à convertir> : Chaîne de caractères ou Buffer
Chaîne ou buffer à convertir.
<Alphabet d'origine> : Constante de type Entier
Alphabet d'origine de la chaîne de caractères ou du buffer à convertir :
| |
alphabetCourant | Alphabet courant spécifié avec la fonction ChangeAlphabet (par défaut alphabetOccidental). |
alphabetUnicode | Alphabet au format UNICODE. |
alphabetUTF16BE | Alphabet au format UTF16 Big Endian. |
alphabetUTF16LE | Alphabet au format UTF16 Little Endian. |
alphabetUTF32 | Alphabet au format UTF32. |
alphabetUTF8 | Alphabet au format UTF8 (utilisé par exemple en XML). |
<Alphabet destination> : Entier
Alphabet à utiliser pour la création de la chaîne ou du buffer résultat :
| |
alphabetCourant | Alphabet courant spécifié avec la fonction ChangeAlphabet (par défaut alphabetOccidental). |
alphabetUnicode | Alphabet au format UNICODE. |
alphabetUTF16BE | Alphabet au format UTF16 Big Endian. |
alphabetUTF16LE | Alphabet au format UTF16 Little Endian. |
alphabetUTF32 | Alphabet au format UTF32. |
alphabetUTF8 | Alphabet au format UTF8 (utilisé par exemple en XML). |