public static CharsetEncoder OnUnmappableCharacter(this CharsetEncoder enc, CodingErrorAction action) { if (action == CodingErrorAction.Report) { enc.Fallback = EncoderFallback.ExceptionFallback; } else { enc.Fallback = EncoderFallback.ReplacementFallback; } return(enc); }
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); }