Using UTF-8 characters
UTF-8 is the default character set used in the BACnet supplement. The UTF-8 character set covers all Unicode characters and requires up to 4 BYTE per character depending on the language.
Regular strings without special characters do not need any specific handling. Latin-1 characters like äöüÄÖÜß©ÔØ, etc. do not require a specific handling either.
In case of Cyrillic, African or Asian characters, a conversion is required. In this case the attribute ‘TcEncoding’ needs to be set to ‘UTF-8’. Like every attribute this applies to the variable below the attribute and needs to be repeated for each variable containing UTF-8 characters.
Example using UTF-8 characters:
{attribute 'TcEncoding' := 'UTF-8'}
sMyUTF8Text : STRING := wsLiteral_TO_UTF8( "äöüßéèêµ€° Ἀθῆναι İstanbul Київ" );
![]() | Please note to use double quotation marks in case of WSTRING variables! |