Chapter 6. String

Table of Contents

6.1. tsStringAnsiToWide
6.2. tsStringAlloc
6.3. tsStringDispose

All strings are null terminated. The wide strings represents the UCS-2 standard. Each char needs 2 byte (1 word) space and can hold the character range U+0000 - U+FFFF.

With these functions you can convert ansi to wide, allocate and dispose them. The created strings are not bound to any context so you can use it anywhere you want. To convert an ansi to wide string you will need an bound context because the context holds the required codepage. For the complete List of supported codepages see below.

[Warning] Warning

All strings you have allocated or converted will be registered and if you call tsQuit they will be freed.

Const Name Description
TS_CODEPAGE_UTF8 UTF-8 8-bit Unicode Transformation Format
TS_CODEPAGE_8859_1 ISO/IEC 8859-1:1998 Latin 1 / West European
TS_CODEPAGE_8859_2 ISO 8859-2:1999 Latin 2 / Middle European
TS_CODEPAGE_8859_3 ISO/IEC 8859-3:1999 Latin 3 / South European
TS_CODEPAGE_8859_4 ISO/IEC 8859-4:1998 Latin 4 / Baltic
TS_CODEPAGE_8859_5 ISO 8859-5:1999 Cyrillic
TS_CODEPAGE_8859_6 ISO 8859-6:1999 Arabic
TS_CODEPAGE_8859_7 ISO 8859-7:2003 Greek
TS_CODEPAGE_8859_8 ISO/IEC 8859-8:1999 Hebrew
TS_CODEPAGE_8859_9 ISO/IEC 8859-9:1999 Latin 5 / Turkish
TS_CODEPAGE_8859_10 ISO/IEC 8859-10:1998 Latin 6 / Nordic
TS_CODEPAGE_8859_11 ISO/IEC 8859-11:2001 Thai
TS_CODEPAGE_8859_13 ISO/IEC 8859-13:1998 Latin 7 / Baltic
TS_CODEPAGE_8859_14 ISO/IEC 8859-14:1998 Latin 8 / Celtic
TS_CODEPAGE_8859_15 ISO/IEC 8859-15:1999 Latin 9 / West europe
TS_CODEPAGE_8859_16 ISO/IEC 8859-16:2001 Latin 10 / South europe
TS_CODEPAGE_037 cp037_IBMUSCanada IBM US Canada
TS_CODEPAGE_437 cp437_DOSLatinUS IBM-PC US (Original IBM code page)
TS_CODEPAGE_500 cp500_IBMInternational  
TS_CODEPAGE_737 cp737_DOSGreek IBM-PC Greek
TS_CODEPAGE_775 cp775_DOSBaltRim IBM-PC
TS_CODEPAGE_850 cp850_DOSLatin1 IBM-PC Multilingual (Latin-1) Western European
TS_CODEPAGE_852 cp852_DOSLatin2 IBM-PC Slavic (Latin-2) Eastern European
TS_CODEPAGE_855 cp855_DOSCyrillic IBM-PC Cyrillic
TS_CODEPAGE_857 cp857_DOSTurkish IBM-PC Turkish
TS_CODEPAGE_860 cp860_DOSPortuguese IBM-PC Portuguese
TS_CODEPAGE_861 cp861_DOSIcelandic IBM-PC Icelandic
TS_CODEPAGE_862 cp862_DOSHebrew IBM-PC Hebrew
TS_CODEPAGE_863 cp863_DOSCanadaF IBM-PC French Canadian
TS_CODEPAGE_864 cp864_DOSArabic IBM-PC Arabic
TS_CODEPAGE_865 cp865_DOSNordic IBM-PC Nordic
TS_CODEPAGE_866 cp866_DOSCyrillicRussian IBM-PC Cyrillic
TS_CODEPAGE_869 cp869_DOSGreek2 IBM-PC Greek
TS_CODEPAGE_874 cp874 IBM-PC Thai
TS_CODEPAGE_875 cp875_IBMGreek IBM-PC Greek
TS_CODEPAGE_1026 cp1026_IBMLatin5Turkish Latin #5 Turkish
TS_CODEPAGE_1250 cp1250 Windows (Latin 2) Central European
TS_CODEPAGE_1251 cp1251 Windows Cyrillic
TS_CODEPAGE_1252 cp1252 Windows Latin 1
TS_CODEPAGE_1253 cp1253 Windows Greek
TS_CODEPAGE_1254 cp1254 Windows Turkish
TS_CODEPAGE_1255 cp1255 Windows Hebrew
TS_CODEPAGE_1256 cp1256 Windows Arabic
TS_CODEPAGE_1257 cp1257 Windows Baltic
TS_CODEPAGE_1258 cp1258 Windows Vietnam

Table 6.1. Codepages

[Note] Note

If you miss some code pages send me an mail. Perfectlly with an link to the code page definition. And i will look what i can do.