Jump to content

Need help in encoding topic


Guest vaibhavgh
 Share

Recommended Posts

Guest vaibhavgh

When i save my UTF16 encoded xml file to UTF8 encoding, its size gets decrease by 50%. I know that UTF16 is double byte encoding and UTF8 is single byte encoding, but what happen actually to the xml file when its encoding gets changes from UTF16 to UTF8.Can anyone help me to find out what is actually double/single byte encoding?Thanks in advance. :)

Link to comment
Share on other sites

I'm not much into encoding, but it sounds as if UTF-8 uses a single byte to represent a single character, while UTF-16 uses 2 bytes to represent a single character. Therefore UTF-16 could represent more different characters but at the cost of bigger file size.I'm not sure, but it seems that when you convert your file to UTF-8, all extra bytes are eliminated and UTF-16 characters should be presented by a single *unknown character* entity, which is most of the times a question mark or a square. If you really need the extra characters, you should try saving your file as Unicode. If your XML looks fine in more then one editor as it is, then you don't use any extra characters and could actually switch to UTF-8 in the XML file itself.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...