Confuse with charset UTF-8 and Unicode

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.
 
M

Martin Honnen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top