<?xml version="1.0" encoding="UTF-8"?>
<fpdoc-descriptions>
  <package name="lazutils">
    <!--
  ====================================================================
    LazUTF8
  ====================================================================
-->
    <module name="LazUTF8">
      <short/>
      <descr/>
      <!-- function Visibility: default -->
      <element name="NeedRTLAnsi">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="NeedRTLAnsi.Result">
        <short/>
      </element>
      <!-- procedure Visibility: default -->
      <element name="SetNeedRTLAnsi">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- argument Visibility: default -->
      <element name="SetNeedRTLAnsi.NewValue">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8ToSys">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8ToSys.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8ToSys.s">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="SysToUTF8">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="SysToUTF8.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="SysToUTF8.s">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8CharacterLength">
        <short>Returns the number of bytes of the codepoint starting at p</short>
        <descr>It returns 0 if p is nil.
It returns 1 if p is a 1-byte UTF-8 codepoint or p is an invalid UTF-8 sequence.
Otherwise it returns a number 2..4. 

It does not check for malicious codepoints like #$c0#$80, nor for non defined codepoints like #$f3#$a0#$87#$b9.

Use UTF8CharacterLength to step through a string with a simple loop:
<br/>                                                                            
while p^&lt;&gt;#0 do begin<br/>                                                                                                            
  inc(p,UTF8CharacterLength(p));<br/>
end;<br/>

Even if p contains invalid UTF-8 it will run through the string without overflow.</descr>
        <errors/>
        <seealso>UTF8CharacterStrictLength</seealso>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8CharacterLength.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharacterLength.p">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8Length">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8Length.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Length.s">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Length.p">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Length.ByteCount">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8CharacterToUnicode">
        <short>Returns the codepoint at p and the number of bytes to skip.</short>
        <descr>If p=nil then CharLen and result are 0 otherwise CharLen&gt;0.
If there is an encoding error the Result is 0 and CharLen=1 to skip forward. It is safe to do:

var s: string;

p:=1;
while p&lt;=length(s) do begin
  UTF8CharacterToUnicode(@s[p],CharLen);
  inc(p,CharLen);
end;

For speed reasons this function only checks for 1,2,3,4 byte encoding errors. Especially it does not check if the codepoint is defined in the unicode table.</descr>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8CharacterToUnicode.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharacterToUnicode.p">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharacterToUnicode.CharLen">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UnicodeToUTF8">
        <short>Encodes the given code point as an UTF-8 sequence of 1 to 4 bytes.</short>
        <descr>It does not add a #0.
The code point is not encoded, aka in UTF32.</descr>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UnicodeToUTF8.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UnicodeToUTF8.u">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UnicodeToUTF8.Buf">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UnicodeToUTF8SkipErrors">
        <short>Simple and fast function to write a single unicode codepoint as UTF-8 to Buf and returns the number of bytes written</short>
        <descr>It does not append a #0.
It does not check if it is the codepoint actually exists in unicode tables.
It returns 0 if the codepoint can not be represented as a 1 to 4 byte UTF-8 sequence.</descr>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UnicodeToUTF8SkipErrors.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UnicodeToUTF8SkipErrors.u">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UnicodeToUTF8SkipErrors.Buf">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8ToDoubleByteString">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8ToDoubleByteString.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8ToDoubleByteString.s">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8ToDoubleByte">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8ToDoubleByte.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8ToDoubleByte.UTF8Str">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8ToDoubleByte.Len">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8ToDoubleByte.DBStr">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8FindNearestCharStart">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8FindNearestCharStart.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8FindNearestCharStart.UTF8Str">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8FindNearestCharStart.Len">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8FindNearestCharStart.BytePos">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8CharStart">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8CharStart.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharStart.UTF8Str">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharStart.Len">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharStart.CharIndex">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8CharToByteIndex">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8CharToByteIndex.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharToByteIndex.UTF8Str">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharToByteIndex.Len">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharToByteIndex.CharIndex">
        <short/>
      </element>
      <!-- procedure Visibility: default -->
      <element name="UTF8FixBroken">
        <short>Replaces all invalid UTF8 characters with spaces. Stops at #0.</short>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8FixBroken.P">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8CharacterStrictLength">
        <short>For a valid UTF-8 character it returns the length in bytes (1..4). Otherwise 0.</short>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8CharacterStrictLength.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CharacterStrictLength.P">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8CStringToUTF8String">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8CStringToUTF8String.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CStringToUTF8String.SourceStart">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CStringToUTF8String.SourceLen">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8Pos">
        <short>Returns the character index, where the SearchForText starts in SearchInText</short>
        <descr>Returns the character index, where the SearchForText starts in SearchInText.
An optional StartPos can be given (as character index, not in byte).
Returns 0 if not found.
</descr>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8Pos.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Pos.SearchForText">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Pos.SearchInText">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8Copy">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8Copy.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Copy.s">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Copy.StartCharIndex">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Copy.CharCount">
        <short/>
      </element>
      <!-- procedure Visibility: default -->
      <element name="UTF8Delete">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Delete.s">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Delete.StartCharIndex">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Delete.CharCount">
        <short/>
      </element>
      <!-- procedure Visibility: default -->
      <element name="UTF8Insert">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Insert.source">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Insert.s">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8Insert.StartCharIndex">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8LowerCase">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8LowerCase.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8LowerCase.AInStr">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8LowerCase.ALanguage">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8UpperCase">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8UpperCase.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8UpperCase.AInStr">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8UpperCase.ALanguage">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="FindInvalidUTF8Character">
        <short>Returns -1 if ok, otherwise byte index of invalid UTF8 codepoint</short>
        <descr>It always stops on irregular codepoints. For example Codepoint 0 is normally encoded as #0, but it can also be encoded as #192#0. Because most software does not check this, it can be exploited and is a security risk.

If StopOnNonUTF8 is false it will ignore undefined codes. For example #128. By default it stops on such codes.</descr>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="FindInvalidUTF8Character.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="FindInvalidUTF8Character.p">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="FindInvalidUTF8Character.Count">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="FindInvalidUTF8Character.StopOnNonASCII">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="ValidUTF8String">
        <short>Replace invalid UTF8 and replace #0..#31 characters with '#0'..'#31'</short>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="ValidUTF8String.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ValidUTF8String.s">
        <short/>
      </element>
      <!-- procedure Visibility: default -->
      <element name="AssignUTF8ListToAnsi">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- argument Visibility: default -->
      <element name="AssignUTF8ListToAnsi.UTF8List">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="AssignUTF8ListToAnsi.AnsiList">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8CompareStr">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8CompareStr.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CompareStr.S1">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CompareStr.S2">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8CompareText">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8CompareText.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CompareText.S1">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8CompareText.S2">
        <short/>
      </element>
      <!-- enumeration type Visibility: default -->
      <element name="TConvertResult">
        <short/>
        <descr/>
        <seealso/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertResult.trNoError">
        <short/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertResult.trNullSrc">
        <short/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertResult.trNullDest">
        <short/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertResult.trDestExhausted">
        <short/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertResult.trInvalidChar">
        <short/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertResult.trUnfinishedChar">
        <short/>
      </element>
      <!-- enumeration type Visibility: default -->
      <element name="TConvertOption">
        <short/>
        <descr/>
        <seealso/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertOption.toInvalidCharError">
        <short/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertOption.toInvalidCharToSymbol">
        <short/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertOption.toUnfinishedCharError">
        <short/>
      </element>
      <!-- enumeration value Visibility: default -->
      <element name="TConvertOption.toUnfinishedCharToSymbol">
        <short/>
      </element>
      <!-- set type Visibility: default -->
      <element name="TConvertOptions">
        <short/>
        <descr/>
        <seealso/>
      </element>
      <!-- function Visibility: default -->
      <element name="ConvertUTF8ToUTF16">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="ConvertUTF8ToUTF16.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF8ToUTF16.Dest">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF8ToUTF16.DestWideCharCount">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF8ToUTF16.Src">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF8ToUTF16.SrcCharCount">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF8ToUTF16.Options">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF8ToUTF16.ActualWideCharCount">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="ConvertUTF16ToUTF8">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="ConvertUTF16ToUTF8.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF16ToUTF8.Dest">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF16ToUTF8.DestCharCount">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF16ToUTF8.Src">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF16ToUTF8.SrcWideCharCount">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF16ToUTF8.Options">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="ConvertUTF16ToUTF8.ActualCharCount">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF8ToUTF16">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF8ToUTF16.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF8ToUTF16.S">
        <short/>
      </element>
      <!-- function Visibility: default -->
      <element name="UTF16ToUTF8">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- function result Visibility: default -->
      <element name="UTF16ToUTF8.Result">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="UTF16ToUTF8.S">
        <short/>
      </element>
      <!-- procedure Visibility: default -->
      <element name="LazGetLanguageIDs">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- argument Visibility: default -->
      <element name="LazGetLanguageIDs.Lang">
        <short/>
      </element>
      <!-- argument Visibility: default -->
      <element name="LazGetLanguageIDs.FallbackLang">
        <short/>
      </element>
      <!-- procedure Visibility: default -->
      <element name="LazGetShortLanguageID">
        <short/>
        <descr/>
        <errors/>
        <seealso/>
      </element>
      <!-- argument Visibility: default -->
      <element name="LazGetShortLanguageID.Lang">
        <short/>
      </element>
      <!-- variable Visibility: default -->
      <element name="FPUpChars">
        <short/>
        <descr/>
        <seealso/>
      </element>
    <element name="UTF8Trim"><short>Removes space at start and end</short><descr>It removes spaces, tabs, line breaks and control characters at start and end.
Use Flags to only delete at start or only at end or to to not delete line breaks.
Control characters are the unicode sets C0 and C1 and the left-to-right and right-to-left marks.</descr>
      </element>
    <element name="UTF8PosP"><short>Returns the position where SearchInText starts in SearchForText</short><descr>If not found it returns nil.
Null characters #0 are treated as normal characters.</descr>
      </element>
    <element name="UTF8CompareStrCollated"><short>Compare two strings using language specific sorting</short>
      </element>
    <element name="GetEnvironmentVariableCountUTF8"><short>Returns the number of system environment variables.</short><descr>Use together with GetEnvironmentStringUTF8.</descr>
      </element><element name="GetEnvironmentStringUTF8"><short>Returns a system environment string.</short><descr>The index is 1 to GetEnvironmentVariableCountUTF8.
On Unix and Windows the string often has the form 'name=value'.
Beware that Windows knows some special formats, e.g. '=C:=SomePath'.

Use GetEnvironmentVariableUTF8 to lookup environment values by name.</descr>
      </element><element name="GetEnvironmentVariableUTF8"><short>Returns the value of a system environment variable.</short><descr>Returns the value of a environment string of the form 'EnvVar=value'.
See GetEnvironmentStringUTF8 to retrieve the whole list of environment strings.</descr>
      </element>
    </module>
    <!-- LazUTF8 -->
  </package>
</fpdoc-descriptions>
