ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / String functions
  • Conversion result
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Converts:
  • a character string in ANSI (Windows) format into a character string in Unicode format.
  • a buffer containing a string in ANSI (Windows) format into a buffer containing a string in Unicode format.
Reminder:
  • ANSI is the character set used in Windows.
  • Unicode is a character encoding standard. Unicode is used to manage different languages and character sets.
Example
MonBufferUnicode is Buffer
// Conversion du buffer MonBufferAnsi
// contenant une chaîne de caractères au format ANSI
// en un buffer contenant une chaîne de caractères au format Unicode
MonBufferUnicode = AnsiToUnicode(MonBufferAnsi)
WindowsLinuxUser code (UMC)
// Code à utiliser dans un projet non Unicode
MaChaîneUnicode is string Unicode
MaChaîneUnicode = AnsiToUnicode("Le développement facile", charsetGreek)
Syntax
WindowsLinuxUser code (UMC)

Converting an ANSI character string Hide the details

<Result> = AnsiToUnicode(<String to convert> [, <Charset>])
<Result>: Unicode string
  • Unicode string.
  • EOT if a conversion problem occurred.
<String to convert>: Character string
ANSI string to convert.
<Charset>: Optional Integer constant
Character set that will be used for the conversion.
charsetAnsiRoman characters in ANSI standard.
charsetArabicArabic characters.
charsetBalticBaltic characters.
charsetChineseChinese characters (People's Republic of China).
charsetCurrent
(Default value)
Uses the current character set specified with ChangeCharset (charsetOccidental by default).
charsetDefaultUses the computer's default character set. No character set is forced.
charsetEastEuropeEastern European characters (Polish, etc.)
charsetGreekGreek characters.
charsetHebrewHebrew characters.
charsetJapaneseJapanese characters.
charsetKoreanKorean characters
charsetMacMac Roman character set (used in previous versions of Macintosh).
charsetRussianRussian characters.
charsetThaiThai characters;.
charsetTraditionalChineseTraditional Chinese characters (Republic of Taiwan).
charsetTurkishTurkish characters.
charsetUTF8Used to manage UTF-8 (used in XML, for example).
charsetVietnameseVietnamese characters.

Converting a buffer containing an ANSI string Hide the details

<Result> = AnsiToUnicode(<Buffer> [, <Charset>])
<Result>: Buffer
  • Buffer containing a string in Unicode format.
  • EOT if a conversion problem occurred.
<Buffer>: Buffer
Buffer containing an ANSI string to convert. If <Buffer> contains a string in Unicode format, <Résultat> will contain an invalid string.
<Charset>: Optional Integer constant
Character set that will be used for the conversion.
charsetAnsiRoman characters in ANSI standard.
charsetArabicArabic characters.
charsetBalticBaltic characters.
charsetChineseChinese characters (People's Republic of China).
charsetCurrent
(Default value)
Current character set specified with ChangeCharset (charsetOccidental by default).
charsetDefaultUses the computer's default character set. No character set is forced.
charsetEastEuropeEastern European characters (Polish, etc.).
charsetGreekGreek characters.
charsetHebrewHebrew characters.
charsetJapaneseJapanese characters.
charsetKoreanKorean characters.
charsetMacMac Roman character set (used in previous versions of Macintosh).
charsetOccidentalRoman characters in ANSI standard.
charsetRussianRussian characters.
charsetThaiThai characters;.
charsetTraditionalChineseTraditional Chinese characters (Republic of Taiwan).
charsetTurkishTurkish characters.
charsetUTF8Used to manage UTF-8 (used in XML, for example).
charsetVietnameseVietnamese characters.
Remarks

Conversion result

The result of the conversion is a string or buffer in Unicode format. This string (or buffer) can therefore only be manipulated by variables and functions that handle Unicode format.
In the event of confusion between a string in Unicode format and a string in ANSI format, conversion will be implicitly performed.
For more details on Unicode, see Unicode management.
Component: wd300vm.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Mobile
PARA RESOLVER PROBLEMAS DE ACENTUAÇÃO

Prezados,

Caso de problema com acentuação, use:

retorno is string = UFT8toString(textocomacento)

USE O COMANDO UTF8ToString OU AnsiToUnicode


Procedure WS_Android_IOS_HTTPGetResult()

// Variable
bufResHTTP is Buffer
sHTTPResult is string

// Retrieves the result of the query

bufResHTTP=HTTPGetResult(httpResult)

// Result in UTF8 em iOS Apple

If IniOSMode() =True OR IniOSSimulatorMode() =True OR IniOSEmulatorMode() =True

IF StringCount(bufResHTTP, “ISO-8859-1”,IgnoreCase) =0

sHTTPResult=UTF8ToString(bufResHTTP)

ELSE

sHTTPResult=AnsiToUnicode(bufResHTTP)

END

ELSE IF inAndroidMode() =True OR InAndroidSimulatorMode() =True OR InAndroidEmulatorMode() =True

// Result in Android

sHTTPResult=bufResHTTP

END

RESULT sHTTPResult
Boller
27 Mar. 2024

Last update: 03/25/2025

Send a report | Local help