LGF_DecodeUtf8 (FC / V1.0.0)

Overview

Author: Siemens Online Support

Short description

Decodes a UTF-8 encoded byte stream into a WString

Block Interface

LGF_DecodeUtf8 (FC)
Array[*] of Byte  byteStream Ret_Val  Word
    
DInt  startPos   
    
UInt  count   
    
WString  decodedString  WString
       
   

Input parameter

IdentifierData type Description
byteStreamArray[*] of Byte UTF-8 encoded byte stream
startPosDInt Position in byte stream to start decoding from
countUInt Number of character (not bytes) to decode; 0: byte stream is decoded until end

Output parameter

IdentifierData type Description
Ret_ValWord 16#0000 - 16#7FFF: Status of the FC, 16#8000 - 16#FFFF: Error identification

In/Out parameter

IdentifierData type Description
decodedStringWString Decoded string

Status & Error codes

Code / ValueIdentifier / Description
16#0000STATUS_NO_ERROR
Status: No error
16#7FFDWARN_UNSUPPORTED_CHAR
Warning: Byte stream was decoded but contained unsupported characters
16#7FFEWARN_STREAM_EXCEEDS_MAX_LEN
Warning: Byte stream exceeds max. length of the string at parameter `decodedString`
16#8201ERR_START_POS_OUTSIDE
Error: Parameter `startPos` is outside array bounds
16#8202ERR_COUNT_EXCEEDS_BOUNDS
Error: Parameter `count` is outside array bounds
16#8203ERR_COUNT_EXCEEDS_MAX_LEN
Error: Parameter `count` exceeds max. length of a WString

Change log

Version & DateChange description
01.00.00Online Support
2022-12-16First released version