[Mono-dev] Re: [Mono-devel-list] mcs patch for default encoding

Atsushi Eno atsushi at ximian.com
Mon Aug 22 06:21:56 EDT 2005

Hi again,

> Agreed. In fact, I was also fixing bug #75065, maybe duplicate.
> I have a fix for UTF8Encoding, but it uncovered another mcs bug
> which does not handle files with BOM with specific encoding.
> To summarize the situation:
>     - Currently driver.cs does not process source files with
>       default encoding.
>     - UTF8Encoding.cs does not handle U+FEFF correctly.
>     - When we fix UTF8Encoding.cs to handle U+FEFF, it starts
>       to reject some source files which has BOM.
>       (CS8025:Parsing error)
>     - Even if we fix driver.cs to let StreamReader consider BOM
>       (currently we disable it), there are still some files
>       borking.
> Am digging into this bug in depth. Hopefully I'll post a set of
> fixes later.

... and now I finished the fixes as was done in the attached patch:

	- driver.cs :
	  a) uses Encoding.Default for the default input.
	  b) Always use true for detecting BOM at any time.
	- support.cs : Handle preamble_size precisely.
	- UTF8Encoding.cs : it should not skip U+FEFF. This fixes
	  bug #73086 and #75065.

They should be applied at a time, except for a).

Atsushi Eno
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mcs-encoding-fix.patch
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20050822/524ee492/attachment.pl 

More information about the Mono-devel-list mailing list