6.1. tsStringAnsiToWide

Syntax

Pascal

function tsStringAnsiToWide(pText: pAnsiChar): pWideChar;

C/C++

WideChar * tsStringAnsiToWide(char * pText);

Description

Converts a ansi string to an wide string which is used by the library. For the conversion the actual codepage will be used. This can be changed with tsSetParameter. The codepage is a part of the active Context so you will need to have an active Context to use this function.

Parameters

pText

Contains an nullterminated string with ansi chars.

Return Values

Return value is an null terminated widestring which contains the converted string.

If any error occours the return value will be nil / NULL.

Error Codes

TS_NOT_INITIALIZED

The internal garbage collection needs to register the strings so the TextSuite library needs to be initialized. See also tsInit.

TS_NO_ACTIVE_CONTEXT

This error will ocour if you havn't bound an context.

TS_OUT_OF_MEMORY

If you try to convert a string that is to large.

TS_INVALID_OPERATION

This could happen if there are some uninitialited internal values. But in normal case this wouldn't happen. If you get this error please send me an mail.

TS_INVALID_VALUE

If you pass nil / NULL to this function

TS_ERROR

There was an unknown error. Please inform me in which case this happens.