Ansi2Unicode - Convert an ANSI text string to Unicode

Top  Previous  Next

Syntax

<cUnicodeText> := Ansi2Unicode( <cAnsiText> [, <nAddChr0Count>] )

Parameters

<cAnsiText>

 

Text in Ansi character set to be converted to Unicode.

 

<nAddChr0Count>

 

<nAddChr0Count> is the number of additional 0-bytes to be added to the return string. The default is 0.

Return value

The Unicode equivalent of the passed Ansi character string.

Description

Ansi2Unicode converts an Ansi text string to Unicode. Note that an O/S function receiving a Unicode text string requires two trailing zero bytes to recognize the end of the string.

 

The API function used for conversion is MultiByteToWideChar. Embedded 0-bytes in <cAnsiText> are not allowed.

Classification

Core

Category

Character set conversion

Quick Info

Library: cckptcor.lib / cckptcor.dll

See also

Unicode2Ansi, ConvWTextIn

Example

 

* Convert all german umlauts to Unicode (source must be in ANSI)

unicodeString := Ansi2Unicode("äöüÄÖÜ")