StrAnsi2Unicode Function

Action

Converts a string from single-byte representation to unicode representation.

Include file

Kernel.bdh

Syntax

StrAnsi2Unicode( out sUnicode     : string,
                 in  nUnicodeByte : number,
                 in  sAnsi        : string ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sUnicode String receiving the unicode representation.
nUnicodeByte Number of bytes to be used from sUnicode buffer.
sAnsi String in single-byte representation that is to be converted.

Example

dcltrans
  transaction TMain
  var
    sAnsi, sUnicode: string;
  begin
    sAnsi := "hello world!";
    StrAnsi2Unicode(sUnicode, STRING_COMPLETE, sAnsi);
    writeln(StrUnicodeLen(sUnicode));
    StrUnicode2Ansi(sAnsi, STRING_COMPLETE, sUnicode);
  end TMain;