(Encodings.WithFatalFallback): turned into Encoding extension method.

This commit is contained in:
morkt 2014-07-29 11:48:43 +04:00
parent 4561157854
commit 6330309552

View File

@ -35,11 +35,11 @@ namespace GameRes
{
public static readonly Encoding cp932 = Encoding.GetEncoding (932);
public static Encoding WithFatalFallback (Encoding enc)
public static Encoding WithFatalFallback (this Encoding enc)
{
enc = enc.Clone() as Encoding;
enc.EncoderFallback = EncoderFallback.ExceptionFallback;
return enc;
var encoding = enc.Clone() as Encoding;
encoding.EncoderFallback = EncoderFallback.ExceptionFallback;
return encoding;
}
}