[nem-en] Re: Language support and BOM

Andrey Khropov andrey.khropov at gmail.com
Tue Jan 30 00:15:11 CET 2007


Alexey Borzenkov wrote:

So, as far as I can see the only problem is how to treat files without BOM.

The possible variants that I can see:

1) as being in UTF-8 (that's the current behavior, isn't it?)
2) as being in machine's default encoding (that's what VS and C# compilers
(both csc and gmcs) do)

3) refuse to compile them at all and:

 3.1) force user to provide a special -codepage flag or
 3.2) refuse to compile files without BOM at all (pretty harsh, huh?)

I think that 1 is definitely not good because it clearly leads to errors,
2 is the best because it follows the principle of the least surprise for C#
developers and 3.1 is OK and 3.2 is not so good (but better than 1).

But 3.2 is the easiest to implement among correct solutions (just check for BOM
and raise an exception if it's not present).

-- 
AKhropov




More information about the devel-en mailing list