LConvEncoding unit
Contains routines used to perform conversions between Unicode and System Code Page encodings.
lconvencoding.pas provides types, variable, constants, and
routines used to perform conversions to and from Unicode and /or System Code
Page encodings. Functions in this unit are thread-safe.
For environments where the RTL uses UTF-8 encoding, the UseSystemCPConv compiler define is enabled to include System Code Page conversions.
lconvencoding.pas is part of the
LazUtils package.
Procedures and functions
ConvertEncoding | function | Converts the specified value from its source encoding to a target encoding using an optional code page. |
ConvertEncodingFromUTF8 | function | Converts the encoded value from UTF-8 to the encoding with the specified name. |
ConvertEncodingToUTF8 | function | Converts the specified string value to the UTF-8 encoding. |
CP1250ToUTF8 | function | Converts a Code Page 1250-encoded string to UTF-8. |
CP1251ToUTF8 | function | Converts a Code Page 1251-encoded value to UTF-8. |
CP1252ToUTF8 | function | Converts a Code Page 1252-encoded value to UTF-8. |
CP1253ToUTF8 | function | Converts a Code Page 1253-encoded value to UTF-8. |
CP1254ToUTF8 | function | Converts a Code Page 1254-encoded value to UTF-8. |
CP1255ToUTF8 | function | Converts a Code Page 1255-encoded value to UTF-8. |
CP1256ToUTF8 | function | Converts a Code Page 1256-encoded value to UTF-8. |
CP1257ToUTF8 | function | Converts a Code Page 1257-encoded value to UTF-8. |
CP1258ToUTF8 | function | Converts a Code Page 1258-encoded value to UTF-8. |
CP437ToUTF8 | function | Converts a Code Page 437-encoded value to UTF-8. |
CP850ToUTF8 | function | Converts a Code Page 850-encoded value to UTF-8. |
CP852ToUTF8 | function | Converts a Code Page 852-encoded value to UTF-8. |
CP865ToUTF8 | function | Converts a Code Page 852-encoded value to UTF-8. |
CP866ToUTF8 | function | Converts a Code Page 866-encoded value to UTF-8. |
CP874ToUTF8 | function | Converts a Code Page 874-encoded value to UTF-8. |
CP932ToUTF8 | function | Converts a string value using Code Page 932 to UTF-8. |
CP936ToUTF8 | function | Converts a string value using Code Page 936 to UTF-8. |
CP949ToUTF8 | function | Converts a string value using Code Page 949 to UTF-8. |
CP950ToUTF8 | function | Converts a string value using Code Page 950 to UTF-8. |
GetConsoleTextEncoding | function | Gets the encoding used for a console application on the platform. |
GetDefaultTextEncoding | function | Gets the name for the default text encoding used on the platform or operating system. |
GetSupportedEncodings | procedure | Adds supported encoding names for the platform to the specified string list. |
GuessEncoding | function | Tries to determine the encoding used for the specified value. |
GuessPascalEncoding | function | Works like GuessEncoding but also supports {%encoding ...} directive. |
ISO_8859_10ToUTF8 | function | Converts a string from its ISO 8859-10 (Latin-6) encoding to UTF-8 encoding. |
ISO_8859_13ToUTF8 | function | Converts a string from its ISO 8859-13 (Latin-7) encoding to UTF-8 encoding. |
ISO_8859_14ToUTF8 | function | Converts an ISO 8859-14-encoded string to UTF-8 encoding. |
ISO_8859_15ToUTF8 | function | Converts an ISO 8859-15-encoded string to UTF-8. |
ISO_8859_16ToUTF8 | function | Converts an ISO 8859-16-encoded string to UTF-8. |
ISO_8859_1ToUTF8 | function | Converts an ISO 8859-1-encoded string to UTF-8. |
ISO_8859_2ToUTF8 | function | Converts an ISO 8859-2-encoded string to UTF-8. |
ISO_8859_3ToUTF8 | function | Converts an ISO 8859-3-encoded string to UTF-8. |
ISO_8859_4ToUTF8 | function | Converts an ISO 8859-4-encoded string to UTF-8. |
ISO_8859_5ToUTF8 | function | Converts an ISO 8859-5-encoded string to UTF-8. |
ISO_8859_7ToUTF8 | function | Converts an ISO 8859-7-encoded string to UTF-8. |
ISO_8859_9ToUTF8 | function | Converts a string from its ISO 8859-9 (Turkish) encoding to UTF-8 encoding. |
KOI8RToUTF8 | function | Converts a KOI8-R-encoded value to UTF-8. |
MacintoshToUTF8 | function | Converts a value encoded using the Macintosh Code Page to UTF-8. |
NormalizeEncoding | function | Converts the specified encoding name to lowercase and removes '-' characters. |
SingleByteToUTF8 | function | Converts a string with single-byte values to UTF-8 using a character translation array. |
UCS2BEToUTF8 | function | Converts a string from UCS 2-byte BE encoding to UTF-8. |
UCS2LEToUTF8 | function | Converts a string from UCS 2-byte LE encoding to UTF-8. |
UTF8BOMToUTF8 | function | Removes the UTF-8 BOM from the UTF-8 encoded value. |
UTF8ToCP1250 | function | Converts a string from UTF-8 encoding to Code Page 1250. |
UTF8ToCP1251 | function | Converts a string from UTF-8 encoding to Code Page 1251. |
UTF8ToCP1252 | function | Converts a string from UTF-8 encoding to Code Page 1252. |
UTF8ToCP1253 | function | Converts a string from UTF-8 encoding to Code Page 1253. |
UTF8ToCP1254 | function | Converts a string from UTF-8 encoding to Code Page 1254. |
UTF8ToCP1255 | function | Converts a string from UTF-8 encoding to Code Page 1255. |
UTF8ToCP1256 | function | Converts a string from UTF-8 encoding to Code Page 1256. |
UTF8ToCP1257 | function | Converts a string from UTF-8 encoding to Code Page 1257. |
UTF8ToCP1258 | function | Converts a string from UTF-8 encoding to Code Page 1258. |
UTF8ToCP437 | function | Converts a string from UTF-8 encoding to Code Page 437. |
UTF8ToCP850 | function | Converts a string from UTF-8 encoding to Code Page 850. |
UTF8ToCP852 | function | Converts a string from UTF-8 encoding to Code Page 852. |
UTF8ToCP865 | function | Converts a string from UTF-8 encoding to Code Page 865. |
UTF8ToCP866 | function | Converts a string from UTF-8 encoding to Code Page 866. |
UTF8ToCP874 | function | Converts a string from UTF-8 encoding to Code Page 874. |
UTF8ToCP932 | function | Converts a string from UTF-8 encoding to Code Page 932. |
UTF8ToCP936 | function | Converts a string from UTF-8 encoding to Code Page 936. |
UTF8ToCP949 | function | Converts a string from UTF-8 encoding to Code Page 949. |
UTF8ToCP950 | function | Converts a string from UTF-8 encoding to Code Page 950. |
UTF8ToDBCS | function | Converts a value from UTF-8 encoding to a Double Byte Character Set encoding. |
UTF8ToISO_8859_1 | function | Converts a string from UTF-8 encoding to ISO 8859-1. |
UTF8ToISO_8859_10 | function | Converts a string from UTF-8 encoding to ISO 8859-10 (Latin-6) encoding. |
UTF8ToISO_8859_13 | function | Converts a string from UTF-8 encoding to ISO 8859-13 (Latin-7) encoding. |
UTF8ToISO_8859_14 | function | Converts a string from UTF-8 encoding to ISO 8859-14. |
UTF8ToISO_8859_15 | function | Converts a string from UTF-8 encoding to ISO 8859-15. |
UTF8ToISO_8859_16 | function | Converts a string from UTF-8 encoding to ISO 8859-16. |
UTF8ToISO_8859_2 | function | Converts a string from UTF-8 encoding to ISO 8859-2. |
UTF8ToISO_8859_3 | function | Converts a string from UTF-8 encoding to ISO 8859-3. |
UTF8ToISO_8859_4 | function | Converts a string from UTF-8 encoding to ISO 8859-3. |
UTF8ToISO_8859_5 | function | Converts a string from UTF-8 encoding to ISO 8859-5. |
UTF8ToISO_8859_7 | function | Converts a string from UTF-8 encoding to ISO 8859-7. |
UTF8ToISO_8859_9 | function | Converts a string from UTF-8 encoding to ISO 8859-9 (Turkish) encoding. |
UTF8ToKOI8R | function | Converts a string from UTF-8 encoding to KOI8-R encoding. |
UTF8ToKOI8RU | function | Converts a string from UTF-8 encoding to KOI8-RU encoding. |
UTF8ToKOI8U | function | Converts a string from UTF-8 encoding to KOI8-U encoding. |
UTF8ToMacintosh | function | Converts a value from UTF-8 encoding to the Macintosh Code Page. |
UTF8ToSingleByte | function | Converts a UTF-8-encoded string value to a single-bye character set using a conversion function. |
UTF8ToUCS2BE | function | Converts a UTF-8-encoded value to UCS 2-byte Big Endian encoding. |
UTF8ToUCS2LE | function | Converts a UTF-8-encoded value to UCS 2-byte Little Endian encoding. |
UTF8ToUTF8BOM | function | Converts a string from UTF-8 encoding to UTF-8 with a Byte Order Mark. |
Types
TCharToUTF8Table | type | Alias for the TCharToUTF8Table type in CodepagesCommon.pas. |
TConvertEncodingErrorMode | enumeration | Represents the behaviors for an error occurring in an encoding conversion. |
TConvertEncodingFunction | procedure type | Specifies a function used to convert a single-byte string value to a specific multi-byte encoding. |
TConvertUTF8ToEncodingFunc | procedure type | Specifies a function used to convert a string value from UTF-8 encoding to another encoding with an optional code page. |
TUnicodeToCharID | procedure type | Specifies an Integer function type used to get a character identifier for a specific Unicode character. |
Constants
EncodingAnsi | constant | Encoding name for ANSI. |
EncodingCP1250 | constant | Encoding name for Code Page 1250. |
EncodingCP1251 | constant | Encoding name for Code Page 1251. |
EncodingCP1252 | constant | Encoding name for Code Page 1252. |
EncodingCP1253 | constant | Encoding name for Code Page 1253. |
EncodingCP1254 | constant | Encoding name for Code Page 1254. |
EncodingCP1255 | constant | Encoding name for Code Page 1255. |
EncodingCP1256 | constant | Encoding name for Code Page 1256. |
EncodingCP1257 | constant | Encoding name for Code Page 1257. |
EncodingCP1258 | constant | Encoding name for Code Page 1258. |
EncodingCP437 | constant | Encoding name for Code Page 437. |
EncodingCP850 | constant | Encoding name for Code Page 850. |
EncodingCP852 | constant | Encoding name for Code Page 852. |
EncodingCP865 | constant | Encoding name for Code Page 865. |
EncodingCP866 | constant | Encoding name for Code Page 866. |
EncodingCP874 | constant | Encoding name for Code Page 874. |
EncodingCP932 | constant | Encoding name for Code Page 932. |
EncodingCP936 | constant | Encoding name for Code Page 936. |
EncodingCP949 | constant | Encoding name for Code Page 949. |
EncodingCP950 | constant | Encoding name for Code Page 950. |
EncodingCPIso1 | constant | Encoding name for ISO 8859-1 Code Page. |
EncodingCPIso10 | constant | Encoding name for ISO 8859-10 Code Page. |
EncodingCPIso13 | constant | Encoding name for ISO 8859-13 Code Page. |
EncodingCPIso14 | constant | Encoding name for ISO 8859-14 Code Page. |
EncodingCPIso15 | constant | Encoding name for ISO 8859-15 Code Page. |
EncodingCPIso16 | constant | Encoding name for ISO 8859-16 Code Page. |
EncodingCPIso2 | constant | Encoding name for ISO 8859-2 Code Page. |
EncodingCPIso3 | constant | Encoding name for ISO 8859-3 Code Page. |
EncodingCPIso4 | constant | Encoding name for ISO 8859-4 Code Page. |
EncodingCPIso5 | constant | Encoding name for ISO 8859-5 Code Page. |
EncodingCPIso7 | constant | Encoding name for ISO 8859-7 Code Page. |
EncodingCPIso9 | constant | Encoding name for ISO 8859-9 Code Page. |
EncodingCPKOI8R | constant | Encoding name for KOI8-R Code Page. |
EncodingCPKOI8RU | constant | Encoding name for KOI8-RU Code Page. |
EncodingCPKOI8U | constant | Encoding name for KOI8-U Code Page. |
EncodingCPMac | constant | Encoding name for the Macintosh Code Page. |
EncodingUCS2BE | constant | Encoding name for UCS 2-byte Big Endian. |
EncodingUCS2LE | constant | Encoding name for UCS 2-byte Little Endian. |
EncodingUTF8 | constant | Encoding name for UTF-8. |
EncodingUTF8BOM | constant | Encoding name for UTF-8 with a byte order mark. |
UTF16BEBOM | constant | ANSI representation for the UTF-16 Big Endian Byte Order Mark. |
UTF16LEBOM | constant | ANSI representation for the UTF-16 Little Endian Byte Order Mark. |
UTF32BEBOM | constant | ANSI representation for the UTF-32 Big Endian Byte Order Mark. |
UTF32LEBOM | constant | ANSI representation for the UTF-32 Little Endian Byte Order Mark. |
UTF8BOM | constant | ANSI representation for the UTF-8 Byte Order Mark. |
Variables
ConvertAnsiToUTF8 | variable | Contains the routine used to convert an ANSI string value to UTF-8 encoding. |
ConvertEncodingErrorMode | variable | Error handling behavior for encoding conversion errors. |
ConvertUTF8ToAnsi | variable | Contains the routine used to convert from UTF-8 encoding to ANSI encoding. |
Uses
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
