diff --git a/src/test/java/org/apache/commons/csv/CSVParserTest.java b/src/test/java/org/apache/commons/csv/CSVParserTest.java index 475b961c..fb53af49 100644 --- a/src/test/java/org/apache/commons/csv/CSVParserTest.java +++ b/src/test/java/org/apache/commons/csv/CSVParserTest.java @@ -361,6 +361,17 @@ public class CSVParserTest extends TestCase { assertFalse("Should not have any more records", iterator.hasNext()); } + public void testUnicodeEscapeMySQL() throws Exception { + String code = "abc\t\\u0070\\u0075\\u0062\\u006C\\u0069\\u0063"; + CSVParser parser = new CSVParser(code, CSVFormat.MYSQL.withUnicodeEscapesInterpreted(true)); + final Iterator iterator = parser.iterator(); + String[] data = iterator.next(); + assertEquals(2, data.length); + assertEquals("abc", data[0]); + assertEquals("public", data[1]); + assertFalse("Should not have any more records", iterator.hasNext()); + } + public void testCarriageReturnLineFeedEndings() throws IOException { String code = "foo\r\nbaar,\r\nhello,world\r\n,kanu"; CSVParser parser = new CSVParser(new StringReader(code));