Docs: LazUtils. Adds or updates topics for changes in 494fa2ab, 573be15e, 262fe00e.

* Includes tagging changes for True and False values in topics.
This commit is contained in:
dsiders 2022-06-08 10:55:33 +01:00
parent 262fe00e31
commit 1ecf28596a
2 changed files with 175 additions and 68 deletions

View File

@ -11,7 +11,9 @@
</descr>
<element name="TCharToUTF8Table">
<short/>
<short>
Array type which provides indexed access to UTF-8 codepoint pointers.
</short>
<descr/>
<seealso/>
</element>
@ -38,6 +40,18 @@
</seealso>
</element>
<element name="ArrayISO_8859_14ToUTF8">
<short>Provides a mapping for ISO-8859-14 characters to UTF-8 codepoints.</short>
<descr>
<p>
<url href="https://en.wikipedia.org/wiki/ISO/IEC_8859-14">ISO/IEC 8859-14</url>
</p>
</descr>
<seealso>
<link id="#lazutils.lconvencoding.ISO_8859_14ToUTF8">ISO_8859_14ToUTF8</link>
</seealso>
</element>
<element name="ArrayISO_8859_15ToUTF8">
<short/>
<descr>

View File

@ -174,6 +174,9 @@
<element name="EncodingCPIso9">
<short>Encoding name for ISO 8859-9 Code Page.</short>
</element>
<element name="EncodingCPIso14">
<short>Encoding name for ISO 8859-14 Code Page.</short>
</element>
<element name="EncodingCPIso15">
<short>Encoding name for ISO 8859-15 Code Page.</short>
</element>
@ -249,6 +252,14 @@
<dd>UTF8ToUTF8BOM</dd>
<dt>EncodingCPIso1 ('iso88591')</dt>
<dd>UTF8ToISO_8859_1</dd>
<dt>EncodingCPIso2 ('iso88592')</dt>
<dd>UTF8ToISO_8859_2</dd>
<dt>EncodingCPIso9 ('iso88599')</dt>
<dd>UTF8ToISO_8859_9</dd>
<dt>EncodingCPIso14 ('iso885914')</dt>
<dd>UTF8ToISO_8859_14</dd>
<dt>EncodingCPIso15 ('iso885915')</dt>
<dd>UTF8ToISO_8859_15</dd>
<dt>EncodingCP1250 ('cp1250')</dt>
<dd>UTF8ToCP1250</dd>
<dt>EncodingCP1252 ('cp1252')</dt>
@ -261,10 +272,10 @@
<dd>ConvertUTF8ToAnsi</dd>
</dl>
<p>
Encoded is a Boolean output parameter which indicates if a routine was found to perform the requested conversion. Its value is False when a conversion routine was not found for the target encoding in ToEncoding.
Encoded is a Boolean output parameter which indicates if a routine was found to perform the requested conversion. Its value is <b>False</b> when a conversion routine was not found for the target encoding in ToEncoding.
</p>
<p>
SetTargetCodePage is a Boolean argument which indicates if SetCodePage is called to apply a translated code page for the converted value. The default value for the argument is False, and omits the code page for the return value.
SetTargetCodePage is a Boolean argument which indicates if SetCodePage is called to apply a translated code page for the converted value. The default value for the argument is <b>False</b>, and omits the code page for the return value.
</p>
<p>
ConvertEncodingFromUTF8 is used in the implementation of the ConvertEncoding function.
@ -287,12 +298,12 @@
</element>
<element name="ConvertEncodingFromUTF8.Encoded">
<short>
True if the return value contains multi-byte encoded values, False if it contains a single-byte ANSI string.
<b>True</b> if the return value contains multi-byte encoded values, <b>False</b> if it contains a single-byte ANSI string.
</short>
</element>
<element name="ConvertEncodingFromUTF8.SetTargetCodePage">
<short>
True if the code page should be set for the return value, False if a code page is not used.
<b>True</b> if the code page should be set for the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -313,6 +324,14 @@
<dd>UTF8BOMToUTF8</dd>
<dt>EncodingCPIso1 ('iso88591')</dt>
<dd>ISO_8859_1ToUTF8</dd>
<dt>EncodingCPIso2 ('iso88592')</dt>
<dd>ISO_8859_2ToUTF8</dd>
<dt>EncodingCPIso9 ('iso88599')</dt>
<dd>ISO_8859_9ToUTF8</dd>
<dt>EncodingCPIso14 ('iso885914')</dt>
<dd>ISO_8859_14ToUTF8</dd>
<dt>EncodingCPIso15 ('iso885915')</dt>
<dd>ISO_8859_15ToUTF8</dd>
<dt>EncodingCP1250 ('cp1250')</dt>
<dd>CP1250ToUTF8</dd>
<dt>EncodingCP1252 ('cp1252')</dt>
@ -325,7 +344,7 @@
<dd>ConvertAnsiToUTF8</dd>
</dl>
<p>
Encoded is a Boolean output parameter which indicates if a routine was found to perform the requested conversion. Its value is False when a conversion routine was not found for the source encoding in FromEncoding.
Encoded is a Boolean output parameter which indicates if a routine was found to perform the requested conversion. Its value is <b>False</b> when a conversion routine was not found for the source encoding in FromEncoding.
</p>
<p>
ConvertEncodingToUTF8 is used in the implementation of the ConvertEncoding function.
@ -353,7 +372,7 @@
</element>
<element name="ConvertEncodingToUTF8.Encoded">
<short>
True if the result contains a multi-byte encoded value. Always True for conversions to UTF-8.
<b>True</b> if the result contains a multi-byte encoded value. Always <b>True</b> for conversions to UTF-8.
</short>
</element>
@ -378,7 +397,7 @@
ConvertEncoding calls ConvertEncodingFromUTF8 to convert the string value when the FromEncoding is UTF-8. ConvertEncodingToUTF8 is called when ToEncoding is UTF-8. For other encoding conversions, ConvertEncodingToUTF8 is called to both get a UTF-8 value which is then converted using ConvertEncodingFromUTF8.
</p>
<p>
SetTargetCodePage indicates whether the string with the converted encoding should set the code page for the result. The default value for the argument is False. The SetTargetCodePage argument is ignored when ToEncoding is the UTF-8 encoding ('utf8'). The code page is always set to CP_UTF8 (65001) when UTF-8 encoding is used in the result.
SetTargetCodePage indicates whether the string with the converted encoding should set the code page for the result. The default value for the argument is <b>False</b>. The SetTargetCodePage argument is ignored when ToEncoding is the UTF-8 encoding ('utf8'). The code page is always set to CP_UTF8 (65001) when UTF-8 encoding is used in the result.
</p>
<p>
For platforms where libiconv is enabled, the iconvert routine is used as a fallback when an encoding conversion routine was not found.
@ -402,11 +421,15 @@
<short>Encoding name for the converted value.</short>
</element>
<element name="ConvertEncoding.SetTargetCodePage">
<short>True if the code page should be set for the converted value. Default is False.</short>
<short>
<b>True</b> if the code page should be set for the converted value. Default is <b>False</b>.
</short>
</element>
<element name="GetDefaultTextEncoding">
<short>Gets the name for the default text encoding used on the platform or operating system.</short>
<short>
Gets the name for the default text encoding used on the platform or operating system.
</short>
<descr>
<p>
GetDefaultTextEncoding gets the default encoding name used for text from the DefaultTextEncoding variable (in the unit implementation), when assigned. Otherwise, platform-specific routines are used to get return value like: GetWindowsEncoding, GetUnixEncoding. The value in the EncodingUTF8 constant is used for the Darwin platforms. The return value contains the encoding used for AnsiString in the FPC RTL, and is retained in the DefaultTextEncoding variable for subsequent calls to the routine.
@ -444,7 +467,9 @@
</element>
<element name="NormalizeEncoding">
<short>Converts the specified encoding name to lowercase and removes '-' characters.</short>
<short>
Converts the specified encoding name to lowercase and removes '-' characters.
</short>
<descr>
<p>
Converts a value like 'UTF-8' to 'utf8', or 'ISO-8859-1' to 'iso88591'.
@ -517,7 +542,9 @@
<short>UTF-8-encoded string value converted in the routine.</short>
</element>
<element name="TConvertUTF8ToEncodingFunc.SetTargetCodePage">
<short>True to set the target code page, False if the code page is not needed.</short>
<short>
<b>True</b> to set the target code page, <b>False</b> if the code page is not needed.
</short>
</element>
<element name="TCharToUTF8Table">
@ -573,7 +600,7 @@
ConvertUTF8ToAnsi is a TConvertUTF8ToEncodingFunc variable with the routine used to convert a string value from UTF-8 encoding to ANSI encoding. A routine which implements the TConvertUTF8ToEncodingFunc interface can be assigned to ConvertUTF8ToAnsi to the conversion.
</p>
<p>
The arguments to the routine include the UTF-8-encoded string converted in the function, and a boolean argument which indicates if the code page should be set for the string in the return value. Set the SetTargetCodePage parameter to True to set the code page for the ANSI string in the return value. The default value for the argument is False.
The arguments to the routine include the UTF-8-encoded string converted in the function, and a boolean argument which indicates if the code page should be set for the string in the return value. Set the SetTargetCodePage parameter to <b>True</b> to set the code page for the ANSI string in the return value. The default value for the argument is <b>False</b>.
</p>
<p>
By default, a routine is <b>NOT</b> assigned to ConvertUTF8ToAnsi.
@ -623,6 +650,22 @@
<short>String with the value in ISO 8859-1 encoding.</short>
</element>
<element name="ISO_8859_14ToUTF8">
<short>Converts an ISO 8859-14-encoded string to UTF-8 encoding.</short>
<descr>
<p>
Calls SingleByteToUTF8 to convert the specified string using the character translation array in ArrayISO_8859_14ToUTF8.
</p>
</descr>
<seealso/>
</element>
<element name="ISO_8859_14ToUTF8.Result">
<short>UTF-8-encoded value for the specified string.</short>
</element>
<element name="ISO_8859_14ToUTF8.s">
<short>String with the value in ISO 8859-14 encoding.</short>
</element>
<element name="ISO_8859_15ToUTF8">
<short>Converts an ISO 8859-15-encoded string to UTF-8.</short>
<descr>
@ -960,6 +1003,7 @@
<seealso>
<link id="TCharToUTF8Table"/>
<link id="#lazutils.codepagescommon.ArrayISO_8859_1ToUTF8">ArrayISO_8859_1ToUTF8</link>
<link id="#lazutils.codepagescommon.ArrayISO_8859_15ToUTF8">ArrayISO_8859_14ToUTF8</link>
<link id="#lazutils.codepagescommon.ArrayISO_8859_15ToUTF8">ArrayISO_8859_15ToUTF8</link>
<link id="#lazutils.codepagescommon.ArrayISO_8859_2ToUTF8">ArrayISO_8859_2ToUTF8</link>
<link id="#lazutils.codepagescommon.ArrayCP1250ToUTF8">ArrayCP1250ToUTF8</link>
@ -1064,7 +1108,9 @@
</seealso>
</element>
<element name="UTF8ToUTF8BOM.Result">
<short>UTF-8-encoded string value after the BOM is inserted at the beginning of the string.</short>
<short>
UTF-8-encoded string value after the BOM is inserted at the beginning of the string.
</short>
</element>
<element name="UTF8ToUTF8BOM.s">
<short>UTF8-encoded string value updated in the routine.</short>
@ -1077,7 +1123,7 @@
<var>UTF8ToISO_8859_1</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the ISO 8859-1 (Central European) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the ISO 8859-1 code page (28591). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the ISO 8859-1 code page (28591). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToISO_8859_1 to perform character conversions needed for the target encoding.
@ -1100,7 +1146,41 @@
</element>
<element name="UTF8ToISO_8859_1.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if the default system code page (CP_ACP) is used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if the default system code page (CP_ACP) is used.
</short>
</element>
<element name="UTF8ToISO_8859_14">
<short>Converts a string from UTF-8 encoding to ISO 8859-14.</short>
<descr>
<p>
<var>UTF8ToISO_8859_14</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the ISO 8859-14 (Latin-8 / Celtic) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the ISO 8859-14 code page (28604). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToISO_8859_14 to perform character conversions needed for the target encoding.
</p>
<p>
UTF8ToISO_8859_14 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
</p>
</descr>
<seealso>
<link id="ConvertEncodingFromUTF8"/>
<link id="UTF8ToSingleByte"/>
<link id="#rtl.system.SetCodePage">SetCodePage</link>
</seealso>
</element>
<element name="UTF8ToISO_8859_14.Result">
<short>String value after conversion to ISO 8859-14.</short>
</element>
<element name="UTF8ToISO_8859_14.s">
<short>UTF-8-encoded string value converted in the routine.</short>
</element>
<element name="UTF8ToISO_8859_14.SetTargetCodePage">
<short>
<b>True</b> if the target code page is set in the return value, <b>False</b> if the default system code page (CP_ACP) is used.
</short>
</element>
@ -1111,7 +1191,7 @@
<var>UTF8ToISO_8859_15</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the ISO 8859-15 (Western European) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the ISO 8859-15 code page (28605). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the ISO 8859-15 code page (28605). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToISO_8859_15 to perform character conversions needed for the target encoding.
@ -1134,7 +1214,7 @@
</element>
<element name="UTF8ToISO_8859_15.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if the default system code page (CP_ACP) is used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if the default system code page (CP_ACP) is used.
</short>
</element>
@ -1145,7 +1225,7 @@
<var>UTF8ToISO_8859_2</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the ISO 8859-2 (Eastern European) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the ISO 8859-2 code page (28592). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the ISO 8859-2 code page (28592). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToISO_8859_2 to perform character conversions needed for the target encoding.
@ -1168,7 +1248,7 @@
</element>
<element name="UTF8ToISO_8859_2.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if the default system code page (CP_ACP) is used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if the default system code page (CP_ACP) is used.
</short>
</element>
@ -1179,7 +1259,7 @@
<var>UTF8ToISO_8859_9</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the ISO 8859-9 (Turkish) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the ISO 8859-9 code page (28599). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the ISO 8859-9 code page (28599). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToISO_8859_9 to perform character conversions needed for the target encoding.
@ -1202,7 +1282,7 @@
</element>
<element name="UTF8ToISO_8859_9.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if the default system code page (CP_ACP) is used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if the default system code page (CP_ACP) is used.
</short>
</element>
@ -1213,7 +1293,7 @@
<var>UTF8ToCP1250</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 1250 (Central European) encoding.
</p>
<p>
UTF8ToCP1250 calls the UTF8ToSingleByte routine using UnicodeToCP1250 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1250 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 1250 in the return value.
UTF8ToCP1250 calls the UTF8ToSingleByte routine using UnicodeToCP1250 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1250 is used instead. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 1250 in the return value.
</p>
<p>
UTF8ToCP1250 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1233,7 +1313,7 @@
</element>
<element name="UTF8ToCP1250.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1244,7 +1324,7 @@
<var>UTF8ToCP1251</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 1251 (Cyrillic) encoding.
</p>
<p>
UTF8ToCP1251 calls the UTF8ToSingleByte routine using UnicodeToCP1251 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#152) to the target code page. The character translation table in UnicodeToCP1251 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 1251 in the return value.
UTF8ToCP1251 calls the UTF8ToSingleByte routine using UnicodeToCP1251 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#152) to the target code page. The character translation table in UnicodeToCP1251 is used instead. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 1251 in the return value.
</p>
<p>
UTF8ToCP1251 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1264,7 +1344,7 @@
</element>
<element name="UTF8ToCP1251.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1275,7 +1355,7 @@
<var>UTF8ToCP1252</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 1252 (Latin 1) encoding.
</p>
<p>
UTF8ToCP1252 calls the UTF8ToSingleByte routine using UnicodeToCP1252 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#128) to the target code page. The character translation table in UnicodeToCP1252 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 1252 in the return value.
UTF8ToCP1252 calls the UTF8ToSingleByte routine using UnicodeToCP1252 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#128) to the target code page. The character translation table in UnicodeToCP1252 is used instead. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 1252 in the return value.
</p>
<p>
UTF8ToCP1252 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1295,7 +1375,7 @@
</element>
<element name="UTF8ToCP1252.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1306,7 +1386,7 @@
<var>UTF8ToCP1253</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 1253 (Greek) encoding.
</p>
<p>
UTF8ToCP1253 calls the UTF8ToSingleByte routine using UnicodeToCP1253 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1253 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 1253 in the return value.
UTF8ToCP1253 calls the UTF8ToSingleByte routine using UnicodeToCP1253 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1253 is used instead. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 1253 in the return value.
</p>
<p>
UTF8ToCP1253 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1326,7 +1406,7 @@
</element>
<element name="UTF8ToCP1253.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1337,7 +1417,7 @@
<var>UTF8ToCP1254</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 1254 (Turkish) encoding.
</p>
<p>
UTF8ToCP1254 calls the UTF8ToSingleByte routine using UnicodeToCP1254 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1254 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 1254 in the return value.
UTF8ToCP1254 calls the UTF8ToSingleByte routine using UnicodeToCP1254 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1254 is used instead. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 1254 in the return value.
</p>
<p>
UTF8ToCP1254 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1357,7 +1437,7 @@
</element>
<element name="UTF8ToCP1254.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1368,7 +1448,7 @@
<var>UTF8ToCP1255</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 1255 (Hebrew) encoding.
</p>
<p>
UTF8ToCP1255 calls the UTF8ToSingleByte routine using UnicodeToCP1255 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1255 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 1255 in the return value.
UTF8ToCP1255 calls the UTF8ToSingleByte routine using UnicodeToCP1255 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1255 is used instead. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 1255 in the return value.
</p>
<p>
UTF8ToCP1255 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1388,7 +1468,7 @@
</element>
<element name="UTF8ToCP1255.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1399,7 +1479,7 @@
<var>UTF8ToCP1256</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 1256 (Arabic) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the Arabic code page (1256). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the Arabic code page (1256). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToCP1256 to perform character conversions needed for the target encoding.
@ -1422,7 +1502,7 @@
</element>
<element name="UTF8ToCP1256.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if the default system code page (CP_ACP) is used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if the default system code page (CP_ACP) is used.
</short>
</element>
@ -1433,7 +1513,7 @@
<var>UTF8ToCP1257</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 1257 (Baltic) encoding.
</p>
<p>
UTF8ToCP1257 calls the UTF8ToSingleByte routine using UnicodeToCP1257 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1257 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 1257 in the return value.
UTF8ToCP1257 calls the UTF8ToSingleByte routine using UnicodeToCP1257 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1257 is used instead. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 1257 in the return value.
</p>
<p>
UTF8ToCP1255 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1453,7 +1533,7 @@
</element>
<element name="UTF8ToCP1257.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1464,7 +1544,7 @@
<var>UTF8ToCP1258</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 1258 (Vietnamese) encoding.
</p>
<p>
UTF8ToCP1258 calls the UTF8ToSingleByte routine using UnicodeToCP1258 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1258 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 1258 in the return value.
UTF8ToCP1258 calls the UTF8ToSingleByte routine using UnicodeToCP1258 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP1258 is used instead. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 1258 in the return value.
</p>
<p>
UTF8ToCP1258 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1484,7 +1564,7 @@
</element>
<element name="UTF8ToCP1258.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1495,7 +1575,7 @@
<var>UTF8ToCP437</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 437 (DOS Latin US) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Latin US code page (437). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Latin US code page (437). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToCP437 to perform character conversions needed for the target encoding.
@ -1518,7 +1598,7 @@
</element>
<element name="UTF8ToCP437.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1529,7 +1609,7 @@
<var>UTF8ToCP850</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 850 (DOS Western Europe) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Western Europe code page (850). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Western Europe code page (850). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToCP850 to perform character conversions needed for the target encoding.
@ -1552,7 +1632,7 @@
</element>
<element name="UTF8ToCP850.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1563,7 +1643,7 @@
<var>UTF8ToCP852</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 852 (DOS Central Europe) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Central Europe code page (852). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Central Europe code page (852). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToCP852 to perform character conversions needed for the target encoding.
@ -1586,7 +1666,7 @@
</element>
<element name="UTF8ToCP852.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1597,7 +1677,7 @@
<var>UTF8ToCP866</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 866 (DOS Cyrillic Russian) encoding.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Cyrillic Russian code page (866). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the DOS Cyrillic Russian code page (866). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToCP866 to perform character conversions needed for the target encoding.
@ -1620,7 +1700,7 @@
</element>
<element name="UTF8ToCP866.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1631,7 +1711,7 @@
<var>UTF8ToCP874</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Code Page 874 (Thai) encoding.
</p>
<p>
UTF8ToCP874 calls the UTF8ToSingleByte routine using UnicodeToCP874 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP874 is used instead. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 874 in the return value.
UTF8ToCP874 calls the UTF8ToSingleByte routine using UnicodeToCP874 to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because of a failure when translating Unicode code points (#129) to the target code page. The character translation table in UnicodeToCP874 is used instead. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 874 in the return value.
</p>
<p>
UTF8ToCP874 is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1651,7 +1731,7 @@
</element>
<element name="UTF8ToCP874.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1662,7 +1742,7 @@
<var>UTF8ToKOI8R</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the KOI8-R (Russian Cyrillic 8-bit) encoding. KOI8R stands for Kod Obmena Informatsiey, 8-bit Russian.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the KOI8-R code page (20866). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the KOI8-R code page (20866). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToKOI8R to perform character conversions needed for the target encoding.
@ -1681,7 +1761,7 @@
</element>
<element name="UTF8ToKOI8R.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1692,7 +1772,7 @@
<var>UTF8ToKOI8U</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the KOI8-U (Russian Ukranian 8-bit) encoding. KOI8R stands for Kod Obmena Informatsiey, 8-bit Ukranian.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the KOI8-U code page (21866). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the KOI8-U code page (21866). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToKOI8U to perform character conversions needed for the target encoding.
@ -1711,7 +1791,7 @@
</element>
<element name="UTF8ToKOI8U.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1722,7 +1802,7 @@
<var>UTF8ToKOI8RU</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the KOI8RU (Russian, Belarusian, Ukranian Cyrillic) encoding.
</p>
<p>
UTF8ToKOI8RU calls the UTF8ToSingleByte routine using UnicodeToKOI8RU to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because KOI8RU does not have an official code page. The character translation table in UnicodeToKOI8RU is used to convert character values for the encoding. When SetTargetCodePage is True, SetCodePage is called (without character conversion) to set the code page to 0 in the return value.
UTF8ToKOI8RU calls the UTF8ToSingleByte routine using UnicodeToKOI8RU to perform character conversions needed for the target encoding. System code pages are not used (when enabled) because KOI8RU does not have an official code page. The character translation table in UnicodeToKOI8RU is used to convert character values for the encoding. When SetTargetCodePage is <b>True</b>, SetCodePage is called (without character conversion) to set the code page to 0 in the return value.
</p>
<p>
UTF8ToKOI8RU is used in the implementation of the ConvertEncodingFromUTF8 encoding conversion routine.
@ -1738,7 +1818,7 @@
</element>
<element name="UTF8ToKOI8RU.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1749,7 +1829,7 @@
<var>UTF8ToMacintosh</var> is a <var>RawByteString</var> function used to convert a UTF-8-encoded string to the Apple Macintosh Roman code page.
</p>
<p>
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the Macintosh Roman code page (10000). If SetTargetCodePage is False, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
For platforms where system code pages are enabled, SetCodePage is called to convert the value to the Macintosh Roman code page (10000). If SetTargetCodePage is <b>False</b>, SetCodePage is called again to apply the CP_ACP (ANSI) code page in the return value.
</p>
<p>
For other platforms, the UTF8ToSingleByte routine is called using UnicodeToMacintosh to perform character conversions needed for the target encoding.
@ -1768,7 +1848,7 @@
</element>
<element name="UTF8ToMacintosh.SetTargetCodePage">
<short>
True if the target code page is set in the return value, False if a code page is not used.
<b>True</b> if the target code page is set in the return value, <b>False</b> if a code page is not used.
</short>
</element>
@ -1802,6 +1882,8 @@
<ul>
<li>UTF8ToISO_8859_1</li>
<li>UTF8ToISO_8859_2</li>
<li>UTF8ToISO_8859_9</li>
<li>UTF8ToISO_8859_14</li>
<li>UTF8ToISO_8859_15</li>
<li>UTF8ToCP1250</li>
<li>UTF8ToCP1251</li>
@ -1845,7 +1927,7 @@
UTF8ToUCS2LE converts the string value in s from its multi-byte variable length UTF-8 encoding to the fixed length 16-bit character set used in the UCS2 LE (Little Endian) encoding. UTF8ToUCS2LE iterates over each of the UTF-8 codepoints in s, and calls NtoLE to convert the Unicode character value to the Least Significant byte order used in the encoding. Unicode characters with a value $FFFF or greater are ignored in the conversion.
</p>
<p>
No actions are performed in the routine when s contains an empty string (''), and the return value is set to an empty string as well.
No actions are performed in the routine when s contains an empty string (''), and the return value is set to an empty string as well.
</p>
<p>
UTF8ToUCS2LE does not include a byte order mark (BOM) in the UCS2-encoded output.
@ -1867,7 +1949,7 @@
UTF8ToUCS2BE converts the string value in s from its multi-byte variable length UTF-8 encoding to the fixed length 16-bit character set used in the UCS2 BE (Big Endian) encoding. UTF8ToUCS2BE iterates over each of the UTF-8 codepoints in s, and calls NtoBE to convert the Unicode character value to the Most Significant byte order used in the encoding. Unicode characters with a value $FFFF or greater are ignored in the conversion.
</p>
<p>
No actions are performed in the routine when s contains an empty string (''), and the return value is set to an empty string as well.
No actions are performed in the routine when s contains an empty string (''), and the return value is set to an empty string as well.
</p>
<p>
UTF8ToUCS2BE does not include a byte order mark (BOM) in the UCS2-encoded output.
@ -1965,7 +2047,7 @@
</element>
<element name="UTF8ToCP932.SetTargetCodePage">
<short>
True to set the code page for the result, False to use the ANSI code page.
<b>True</b> to set the code page for the result, <b>False</b> to use the ANSI code page.
</short>
</element>
@ -1988,7 +2070,7 @@
</element>
<element name="UTF8ToCP936.SetTargetCodePage">
<short>
True to set the code page for the result, False to use the ANSI code page.
<b>True</b> to set the code page for the result, <b>False</b> to use the ANSI code page.
</short>
</element>
@ -2010,7 +2092,7 @@
<short>String value using UTF-8 encoding.</short>
</element>
<element name="UTF8ToCP949.SetTargetCodePage">
<short>True to set the code page for the result, False to use the ANSI code page.</short>
<short><b>True</b> to set the code page for the result, <b>False</b> to use the ANSI code page.</short>
</element>
<element name="UTF8ToCP950">
@ -2032,7 +2114,7 @@
</element>
<element name="UTF8ToCP950.SetTargetCodePage">
<short>
True to set the code page for the result, False to use the ANSI code page.
<b>True</b> to set the code page for the result, <b>False</b> to use the ANSI code page.
</short>
</element>
@ -2048,20 +2130,26 @@
<seealso/>
</element>
<element name="UTF8ToDBCS.Result">
<short>String value using the double-byte character set generated in the conversion function.</short>
<short>
String value using the double-byte character set generated in the conversion function.
</short>
</element>
<element name="UTF8ToDBCS.s">
<short>String value using UTF-8 encoding.</short>
</element>
<element name="UTF8ToDBCS.UTF8CharConvFunc">
<short>Conversion routine used to translate characters to the double-byte encoding used in the result.</short>
<short>
Conversion routine used to translate characters to the double-byte encoding used in the result.
</short>
</element>
<element name="GetSupportedEncodings">
<short>Adds supported encoding names for the platform to the specified string list.</short>
<short>
Adds supported encoding names for the platform to the specified string list.
</short>
<descr>
<p>
<var>GetSupportedEncodings</var> is a procedure used to get the names for the supported encodings on the platform or operating system. GetSupportedEncodings adds each of the encoding names to <var>List</var>; it does <b>NOT</b> removing any existing content in the string list.
<var>GetSupportedEncodings</var> is a procedure used to get the names for the supported encodings on the platform or operating system. GetSupportedEncodings adds each of the encoding names to <var>List</var>; it does <b>NOT</b> remove any existing content in the string list.
</p>
<p>
GetSupportedEncodings stores the following values in the List argument:
@ -2100,6 +2188,8 @@
<ul>
<li>'ISO-8859-1'</li>
<li>'ISO-8859-2'</li>
<li>'ISO-8859-9'</li>
<li>'ISO-8859-14'</li>
<li>'ISO-8859-15'</li>
<li>'KOI8-R'</li>
<li>'KOI8-U'</li>
@ -2108,6 +2198,9 @@
<li>'UCS-2LE'</li>
<li>'UCS-2BE'</li>
</ul>
<p>
GetSupportedEncodings is used to implement the encodings menu for the source editor in the Lazarus IDE, and to implement the TIpHtmlParser class from the Turbo Power IPro package.
</p>
</descr>
<seealso/>
</element>