Skip to content

Commit

Permalink
Correctly handle default encoding.
Browse files Browse the repository at this point in the history
  • Loading branch information
joniles committed Feb 8, 2017
1 parent 823ca9a commit de42a30
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public ParserState(ParserState state)
}

public int currentFont;
public String currentEncoding;
public String currentEncoding = Encoding.ANSI_ENCODING;
public String currentFontEncoding;
public int unicodeAlternateSkipCount = 1;
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public void testEncodingParse() throws Exception
TestUtilities.assertRtfParserDumpMatches(this, new StandardRtfParser(), "testEncodingParse");
}

@Test
public void testDefaultEncodingParse() throws Exception
{
TestUtilities.assertRtfParserDumpMatches(this, new StandardRtfParser(), "testDefaultEncodingParse");
}

@Test
public void testStylesParse() throws Exception
{
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<rtf>
<group>
<command name="rtf" parameter="1"/>
<chars>Test1</chars>
<command name="par"/>
</group>
</rtf>

0 comments on commit de42a30

Please sign in to comment.