Robert Valentino Well-Known Member Licensed User Longtime User Apr 16, 2016 #1 I have a string that I do a Code: Copy Dim InString as String Dim StringBytes() as Byte = InString.GetBytes("UTF8") The length of StringBytes is longer than InString If I do GetBytes("ISO-8859-1") then the lengths are equal. Why does UTF8 return more bytes? BobVal
I have a string that I do a Code: Copy Dim InString as String Dim StringBytes() as Byte = InString.GetBytes("UTF8") The length of StringBytes is longer than InString If I do GetBytes("ISO-8859-1") then the lengths are equal. Why does UTF8 return more bytes? BobVal
KMatle Expert Licensed User Longtime User Apr 16, 2016 #2 UTF8 uses 1-4 bytes to represent a single char 8 Bits = 1 byte -> so you could only represent 256 different values (= chars). That's why UTFx was created. Think about all the languages in the world (liker German with the special chars äöüß) or emoticons in WhatsApp&Facebook. Upvote 0
UTF8 uses 1-4 bytes to represent a single char 8 Bits = 1 byte -> so you could only represent 256 different values (= chars). That's why UTFx was created. Think about all the languages in the world (liker German with the special chars äöüß) or emoticons in WhatsApp&Facebook.
Robert Valentino Well-Known Member Licensed User Longtime User Apr 16, 2016 #3 Brain Fart. Was thinking UTF8 would give me just an 8 byte value... Daa Upvote 0