IsValidRune (FUN) ¶ FUNCTION IsValidRune : BOOL Reports whether diRune can be legally encoded as UTF-8. Code points that are out of range or a surrogate half are illegal. InOut: Scope Name Type Comment Return IsValidRune BOOL Input diRune RUNE Rune to be analyzed
ReduceSegment (FUN) ¶ FUNCTION ReduceSegment : UDINT This fuction reduces a segment to get a segment with only complete utf8 runes in it. It returns the number of the necessary bytes for the utf8 runes. InOut: Scope Name Type Comment Return ReduceSegment UDINT Input pbyData POINTER TO BYTE Pointer to the first byte of segment udiSize UDINT Size of the segment in bytes
RuneCount (FUN) ¶ FUNCTION RuneCount : UDINT Returns the number of runes in pbyData . Erroneous and short encodings are treated as single runes of length 1 byte. InOut: Scope Name Type Comment Return RuneCount UDINT Input pbyData POINTER TO BYTE Pointer to the first byte in memory udiSize UDINT Memory size in byte
RuneLen (FUN) ¶ FUNCTION RuneLen : UDINT Returns the number of bytes required to encode the rune. It returns 0 if the rune is not a valid value to encode in UTF-8. InOut: Scope Name Type Comment Return RuneLen UDINT Input diRune RUNE The rune to be analyzed
Globals ¶ Constants (GVL)
Constants (GVL) ¶ InOut: Scope Name Type Initial Comment Constant c_diRuneError RUNE DINT#16#FFFD The “error” Rune or “Unicode replacement character” c_diMaxRune DINT DINT#16#10FFFF
RUNE (ALIAS) ¶ TYPE RUNE : DINT(0..c_diMaxRune) The term rune appears in the libraries and source code, and means exactly the same as “unicode code point”, with one interesting addition. This library defines the word rune as an alias for the type DINT , so programs can be clear when an integer value represents a code point. Moreover, what you might think of as a character constant is called a rune constant. The type and value of the expression WSTRING#"⌘" is a rune with the integer value DINT#16#2318 .
File and Project Information ¶ Scope Name Type Content FileHeader creationDateTime date 21.06.2023, 11:10:37 companyName string 3S-Smart Software Solutions GmbH libraryFile UTF-8 Encoding Support.library primaryProject True productName CODESYS productProfile CODESYS V3.5 SP16 Patch 3 contentFile UTF-8 Encoding Support.clean.json version version 2.0.0.0 ProjectInformation AutoResolveUnbound bool True Released True LastModificationDateTime date 21.06.2023, 11:10:36 LibraryCategories library-category-list Application|Strings Author string CODESYS Development GmbH Company CODESYS CompiledLibraryCompatibilityVersion CODESYS V3.5 SP16 Patch 3 DefaultNamespace UTF8 Description See: Description DocFormat reStructuredText LanguageModelAttribute qualified-access-only LibDocContent DocsOnly Placeholder UTF8 Project UTF-8 Encoding Support Title UTF-8 Encoding Support UnitTestingDefine UTF8Testing Version version 4.0.0.0
UDPDriver.CreatePort (METH) ¶ METHOD CreatePort : SysTypes.RTS_IEC_RESULT Create a new port InOut: Scope Name Type Comment Return CreatePort SysTypes.RTS_IEC_RESULT Input pPort POINTER TO Port Pointer of the port to be created Output eLogCode ErrorCode