コード例 #1
0
 public static CharsetEncoder OnUnmappableCharacter(this CharsetEncoder enc, CodingErrorAction action)
 {
     if (action == CodingErrorAction.Report)
     {
         enc.Fallback = EncoderFallback.ExceptionFallback;
     }
     else
     {
         enc.Fallback = EncoderFallback.ReplacementFallback;
     }
     return(enc);
 }
コード例 #2
0
 public static CharsetEncoder OnMalformedInput(this CharsetEncoder enc, CodingErrorAction action)
 {
     if (action == CodingErrorAction.Report)
     {
         enc.Encoder.Fallback = EncoderFallback.ExceptionFallback;
     }
     else
     {
         enc.Encoder.Fallback = EncoderFallback.ReplacementFallback;
     }
     return(enc);
 }