RtfPipe icon indicating copy to clipboard operation
RtfPipe copied to clipboard

ansicpg RTF command gives error

Open fvanheeswijk opened this issue 3 years ago • 0 comments

We have an RTF with \ansicpg-535 as command, it gives the following error:

System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. at System.ThrowHelper.ThrowKeyNotFoundException() at System.Collections.Generic.Dictionary`2.get_Item(TKey key) at RtfPipe.TextEncoding.EncodingFromCodePage(Int32 codePage) at RtfPipe.Parser.GetControlWord(String name, Int32 number) at RtfPipe.Parser.<Tokens>d__18.MoveNext() at RtfPipe.Parser.Parse() at RtfPipe.Rtf.ToHtml(RtfSource source, XmlWriter writer, RtfHtmlSettings settings) at RtfPipe.Rtf.ToHtml(RtfSource source, RtfHtmlSettings settings)

In https://github.com/joniles/rtfparserkit/issues/13 I have found a similar issue, apparently negative numbers need to be treated differently.

fvanheeswijk avatar Mar 14 '22 12:03 fvanheeswijk