[Mono-dev] [PATCH] Use UTF-8 encoding for source files in mcs tree and for ChangeLogs

Atsushi Eno atsushi at ximian.com
Wed Aug 16 10:17:03 EDT 2006


Kornél Pál wrote:
> Hi,
> 
> Note that I posted the patch for mcs tree uncompressed but it was too 
> large and hasn't been approved to the list yet so I resend it zipped.
> 
> Currently source files (*.cs; *.vb) use different encodings:
> - ASCII
> - Latin 1
> - UTF-8 (without BOM)
> - UTF-8 (with BOM)
> 
> The same is true for ChangeLogs but there were mixed encodings as well.
> 
> Our mcs compile doen't recongnize UTF-8 without BOM so those files are
> incorrectly compiled if they were in Latin 1.
> 
> All of our source files should use the same encoding to be consistent that
> makes code more maintainable as well. UTF-8 without BOM seems to be a good
> solution as it provides support for every possible Unicode character so 
> this
> is a long-term solution for the problem.
> 
> I used the attached Latin1ToUtf8.cs to convert the encoding of source files
> but I revised each modified character to make sure that the file was
> converted from the right encoding to UTF-8.
> 
> Additional modifications:
> 
> mcs/build/config-default.make: Use UTF-8 as the default encoding for
> compilers
> mcs/class/Managed.Windows.Forms/Makefile: Removed CODEPAGE as UTF-8 is the
> default
> mcs/class/Microsoft.VisualBasic/Makefile: Removed CODEPAGE as UTF-8 is the
> default
> 
> Replaced unnecessary (same visual character) non-ASCII characters with 
> ASCII
> characters in:
> mcs/class/Mono.GetOptions/GetOptTest/GetOptTester.cs
> mcs/class/System.Drawing/Test/DrawingTest/Exocortex.DSP/src/ComplexF.cs
> mcs/class/System.Drawing/Test/DrawingTest/Exocortex.DSP/src/Complex.cs
> mcs/class/Microsoft.VisualBasic/Test/standalone/6797.vb
> 
> Note that removig BOM and the above replacements resulted in 129 more ASCII
> files that were non-ASCII because of BOM or non-ASCII characters.
> 
> I think that there are no side effects of these patches but comments are
> welcome.
> 
> Please review and approve the patches.

Thanks a bunch for the patch! I attached the result of my audit
as "only meaningful code changes" i.e. I believe I read the
entire changes ;-)

If no objection in reasonable days, let's check the patch in.

Atsushi Eno
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mcs-utf8-reduced.diff
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060816/f099b7f9/attachment.pl 


More information about the Mono-devel-list mailing list