ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / String functions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Converts an ANSI or UNICODE string to UTF-8.
Example
MyUNICODEString is UNICODE string = "beginning"
// MyUNICODEString contains the set of bytes: 0064 00E9 0062 0075 0074
 
MyStringInUTF8 is Buffer = StringToUTF8(MyUNICODEString)
// MyStringInUTF8 contains the set of bytes: 64 C3 A9 62 75 74
// The character "é" was encoded in C3 A9
Syntax
<Result> = StringToUTF8(<String to convert> [, <Charset of string to convert>])
<Result>: Character string or Buffer
  • Character string or buffer in UTF-8 format,
  • EOT if conversion problems occurred.
<String to convert>: Character string
String to convert to UTF-8.
<Charset of string to convert>: Optional integer
Source character set of string to convert. By default, this parameter corresponds to the charsetCurrent constant (specified in ChangeCharset).
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.
AndroidAndroid Widget Only this value is available.
charsetEastEuropeEastern European characters (Polish, etc.)
charsetGreekGreek characters
charsetHebrewHebrew characters
charsetJapaneseJapanese characters
charsetKoreanKorean characters
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
Component: wd290vm.dll
Minimum version required
  • Version 10
This page is also available for…
Comments
Exemplo
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: 04/19/2023

Send a report | Local help