ansiToString

ansiToString(): String;

The ansiToString method of the Binary primitive type interprets the binary as ANSI characters and returns a copy converted to a string.

When invoked from an ANSI application, an ANSI string is returned. When invoked from a Unicode application, the binary is converted from ANSI to Unicode, and a Unicode string is returned.

The code fragment in the following example shows the use of the ansiToString method.

str := bin.ansiToString;

When converting from ANSI to Unicode, conversion stops at the first null character. If the binary contains embedded nulls, the string returned from the ANSI to Unicode conversion therefore represents only that part of the binary up to the first null character.