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

Atsushi Eno atsushi at ximian.com
Mon Aug 22 01:59:10 EDT 2005


Any comments on this patch? If we leave this problem as is, most
of native-language dependent applications won't compile fine
(as I experienced on many Japanese sources).

Atsushi Eno

Atsushi Eno wrote:
> Hello,
> 
> I've attached a fix for mcs to not use Latin1 encoding everywhere.
> I think it should be default encoding of current culture (for
> example the codepage is 932 on my Japanese environment, neither
> 28591 nor 1252).
> 
> But in case we really don't have the corresponding encoding that
> CultureInfo.CurrentCulture.TextInfo indicates (it should be
> supplied though), we should use culture-independent encoding, so
> I think it should be utf-8, instead of iso-8859-1.
> 
> Atsushi Eno
> 
> 
> ------------------------------------------------------------------------
> 
> Index: driver.cs
> ===================================================================
> --- driver.cs	(revision 47877)
> +++ driver.cs	(working copy)
> @@ -1374,10 +1374,10 @@
>  			bool parsing_options = true;
>  
>  			try {
> -				encoding = Encoding.GetEncoding (28591);
> +				encoding = Encoding.GetEncoding (CultureInfo.CurrentCulture.TextInfo.ANSICodePage);
>  			} catch {
>  				Console.WriteLine ("Error: could not load encoding 28591, trying 1252");
> -				encoding = Encoding.GetEncoding (1252);
> +				encoding = Encoding.UTF8;
>  			}
>  			
>  			references = new ArrayList ();
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list




More information about the Mono-devel-list mailing list