OPTION CHARACTER MULTIBYTE
This option statement enables multi-byte Unicode characters.
The scope of this statement is the program unit where it is written.
OPTION CHARACTER BYTE
This option statement disables multi-byte characters.
The scope of this statement is the program unit where it is written.
LEN function returns the byte length of the internal representation (UTF-8) .
Note that Full BASIC standardizes only characters of which ordinal is less than 128.
When you manipulate byte strings or a byte file, you must write these in the program units where substring operations, POS-functions, CHR$-functions, ORD-functions, LEN-functions or CHARACTER INPUT statements are used.
Note.The default state of OPTION CHARACTER can be changed at the menu Option - Comatibility - Unit of String manipulation.
Example.1
10 OPTION CHARACTER multibyte 20 LET s$="Ω" 30 PRINT LEN(s$), ord(s$(1:1)) 40 END
Execution results are
1 937
Example.2
10 OPTION CHARACTER byte 20 LET s$="Ω" 30 PRINT LEN(s$), ord(s$(1:1)) 40 END
Execution results are
2 206