PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Conversion to PHP
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Converts a string from ANSI or UNICODE format to UTF8 format.
Versions 15 and later
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
New in version 15
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
Android This function is now available for the Android applications.
WINDEVJava This function is now available for the Java applications.
Versions 17 and later
iPhone/iPad This function is now available for the iPhone/iPad applications.
New in version 17
iPhone/iPad This function is now available for the iPhone/iPad applications.
iPhone/iPad This function is now available for the iPhone/iPad applications.
Versions 18 and later
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
New in version 18
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Android Widget This function is now available in Android Widget mode.
Universal Windows 10 App This function is now available in Windows Store apps mode.
Versions 21 and later
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Apple Watch This function is now available in Apple Watch mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
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 UTF8 format,
  • EOT if conversion problems occurred.
<String to Convert>: Character string (with quotes)
String that will be converted to UTF8 format.
WINDEVWEBDEV - Server code This string can correspond to:
  • an ANSI string in the current character set. The result will be an ANSI string containing the conversion to UTF8.
  • an ANSI string whose character set is specified. The result will be an ANSI string containing the conversion to UTF8. This conversion takes the initial character set into account.
  • a UNICODE string. The result will be a buffer containing the conversion to UTF8.
Windows Mobile This string can be a UNICODE string. The result will be a buffer containing the conversion to UTF8.
<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)
charsetTraditionalChineseTraditional Chinese characters (Republic of Taiwan)
charsetKoreanKorean characters
charsetCurrent
(Default value)
Uses the current character set specified in ChangeCharset (charsetOccidental by default)
charsetDefaultUses the default character set defined for the computer. No character set is forced.
AndroidAndroid Widget Java Only this value is available.
charsetEastEuropeCharacters of Eastern Europe (Polish, ...)
charsetGreekGreek characters
charsetHebrewHebrew characters
charsetJapaneseJapanese characters
charsetRussianRussian characters
charsetThaiThai characters
charsetTurkishTurkish characters
charsetUTF8Used to manage the UTF8 format (used in XML for example).
charsetVietnameseVietnamese characters
Versions 16 and later
Universal Windows 10 App This parameter is ignored in Windows Phone. Only the current character set is used.
New in version 16
Universal Windows 10 App This parameter is ignored in Windows Phone. Only the current character set is used.
Universal Windows 10 App This parameter is ignored in Windows Phone. Only the current character set is used.
Remarks
PHP

Conversion to PHP

The conversion performed in PHP is using the following PHP extensions:
  • the php_iconv.dll extension
  • the php_mbstring.dll extension
If none of these PHP extensions is found, only the Latin-1 characters will be converted (the Chinese or Russian characters will not be converted for example).
The php_iconv.dll and php_mbstring.dll extensions are currently proposed on the PHP servers. To find out whether these extensions are proposed by your hosting company, enter the following information in a search engine: phpinfo <Name of hosting company>.
To install these extensions on your own PHP server, all you have to do is uncomment the requested extension in the PHP.INI file.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230vm.dll
Windows Mobile wp230vm.dll
Java wd230java.jar
Linux wd230vm.so
Android wd230android.jar
Minimum required version
  • Version 10
This page is also available for…
Comments
XML COM ACENTUAÇÃO
s_xml is string=[
<?xml version="1.0" encoding="utf-8"?>
<consMDFeNaoEnc xmlns="http://www.portalfiscal.inf.br/mdfe" versao="1.00">
<tpAmb>2</tpAmb>
<xServ>CONSULTAR NÃO ENCERRADOS</xServ>
<CNPJ>00397887000101</CNPJ>
</consMDFeNaoEnc>
]
fSaveText("C:\TEMP\XML_ACENTO.xml",StringToUTF8(s_xml))

// BLOG COM VIDEO E EXEMPLO

http://windevdesenvolvimento.blogspot.com.br/2017/08/aula-1228-windev-string-40-stringtoutf8.html

https://www.youtube.com/watch?v=mhlb_WwDymk

De matos
Aug. 01 2017