Confuse with charset UTF-8 and Unicode

  • Thread starter Thread starter Julia
  • Start date Start date
J

Julia

Hi,
I understand that JavaScript uses Unicode strings
in such a way that each char is composed from 2 bytes
so I wonder what happen when I am setting the char set to UTF-8
according to RFC UTF-8 char can be up to 6 bytes long?

Thanks in advance.
 
Julia wrote:

I understand that JavaScript uses Unicode strings
in such a way that each char is composed from 2 bytes
so I wonder what happen when I am setting the char set to UTF-8
according to RFC UTF-8 char can be up to 6 bytes long?

Unicode assigns each character a character code, whether then UTF-8 or
UTF-16 is used to encode characters shouldn't matter to you when
scripting, you simply deal with Unicode characters and not with the bits
or bytes they are encoded with.
 
Back
Top