ByteLen() and Unicode

Report any Hollywood bugs here
Post Reply
User avatar
msu
Posts: 43
Joined: Mon Jun 13, 2016 11:36 am
Location: Sinzig/Germany

ByteLen() and Unicode

Post by msu » Sat May 04, 2019 3:03 pm

Under Windows10 x64:

Code: Select all

SetDefaultEncoding(#ENCODING_UTF8, #ENCODING_UTF8)
a$ = "H"
DebugPrint(ByteLen(a$))
Normally, the result should be 4 bytes.

According to ByteLen, a$ is only 1 byte in size. :?:

User avatar
airsoftsoftwair
Posts: 2968
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: ByteLen() and Unicode

Post by airsoftsoftwair » Sat May 04, 2019 5:44 pm

Huh? "H" is one byte in UTF-8... this isn't UTF-32...

User avatar
msu
Posts: 43
Joined: Mon Jun 13, 2016 11:36 am
Location: Sinzig/Germany

Re: ByteLen() and Unicode

Post by msu » Sat May 04, 2019 9:10 pm

I should have looked at the utf8 table before. :oops:
Only from position 128, the characters are 2 bytes in size ....

Post Reply