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
  • UTF-8 and ANSI conversion
  • Conversion in PHP
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Converts a string in ANSI (Windows) format into 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
// Code à utiliser dans un projet non Unicode
MaChaîneUnicode is string Unicode
MaChaîneAnsi is string ANSI
MaChaîneAnsi = "Le développement facile"
MaChaîneUnicode = MaChaîneAnsi.AnsiToUnicode(charsetGreek)
Syntax

Converting an ANSI character string Hide the details

<Result> = <String to convert>.AnsiToUnicode([<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.
Remarks

Conversion result

The result of the conversion is a string in Unicode format. This string can therefore only be manipulated by variables and functions that handle the 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.
Reports and QueriesWindowsLinuxAndroidAndroid Widget User code (UMC)AjaxStored procedures

UTF-8 and ANSI conversion

To convert an ANSI string to UTF-8, use StringToUTF8.
To convert a UFT-8 string to ANSI, use:
PHP

Conversion in PHP

The conversion in PHP uses the following extensions:
  • the php_iconv.dll extension
  • the php_mbstring.dll extension
If none of these PHP extensions are used, only Latin characters will be converted (e.g., Chinese or Russian characters will not be converted).
The php_iconv.dll and php_mbstring.dll extensions are currently proposed on PHP servers. To find out if your host offers these extensions, simply enter the following information into a search engine: phpinfo <Host Name>.
To install these extensions on your own PHP server, simply uncomment the desired extension in the PHP.INI file.
Component: wd300vm.dll
Minimum version required
  • Version 26
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/25/2025

Send a report | Local help