From 32f3dd134f06afe885717c76e11c418d21965fa4 Mon Sep 17 00:00:00 2001 From: morkt Date: Tue, 29 Jul 2014 06:54:46 +0400 Subject: [PATCH] (Encodings): added WithFatalFallback static method. --- GameRes/ArcView.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/GameRes/ArcView.cs b/GameRes/ArcView.cs index f2525d45..d3adf700 100644 --- a/GameRes/ArcView.cs +++ b/GameRes/ArcView.cs @@ -34,6 +34,13 @@ namespace GameRes public static class Encodings { public static readonly Encoding cp932 = Encoding.GetEncoding (932); + + public static Encoding WithFatalFallback (Encoding enc) + { + enc = enc.Clone() as Encoding; + enc.EncoderFallback = EncoderFallback.ExceptionFallback; + return enc; + } } public static class StreamExtension