Skip to content

Commit c86b438

Browse files
authored
Add failing test for #497 (#498)
1 parent 288eacc commit c86b438

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.fasterxml.jackson.dataformat.csv.failing;
2+
3+
import java.nio.charset.StandardCharsets;
4+
5+
import com.fasterxml.jackson.databind.*;
6+
7+
import com.fasterxml.jackson.dataformat.csv.*;
8+
9+
// [dataformats-text#497]: 3-byte UTF-8 character at end of content
10+
public class UnicodeRead497Test extends ModuleTestBase
11+
{
12+
private final CsvMapper MAPPER = mapperForCsv();
13+
14+
// [dataformats-text#497]
15+
public void testUnicodeAtEnd() throws Exception
16+
{
17+
StringBuilder sb = new StringBuilder(4001);
18+
for (int i = 0; i < 4000; ++i) {
19+
sb.append('a');
20+
}
21+
sb.append('\u5496');
22+
String doc = sb.toString();
23+
JsonNode o = MAPPER.reader() //.with(schema)
24+
.readTree(doc.getBytes(StandardCharsets.UTF_8));
25+
assertNotNull(o);
26+
}
27+
}

0 commit comments

Comments
 (0)