encoding - Why would I use a Unicode Signature Byte-Order-Mark (BOM)? -


Is this obsolete? They look like the worst idea - embed anything in the contents of your file which nobody can see, but affects the functionality of the file. I do not understand why I want to.

In some cases, because there are both small-endian and large-endian implementations of UTF-16.

While reading an unknown UTF-16 file, how can you tell which of these two are used?

That's what BOM does.

And do you need one? Only if you are using 1) UTF encoding where the endpoint is an issue (it matters for UTF-16, but UTF 8 always looks the same regardless of equality), and The file is being shared with external applications.

If your app is the only one who is going to read and write the file, then you can leave the BOM, and you can make a decision once and all of which are going to use endlessness. But if any other application has to read the file, it will not know at the end in the end, so adding BOM can be a good idea.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -