Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-258

Error on read of special characters with little endian encoding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Not A Bug
    • 1.8
    • None
    • Parser
    • None

    Description

      Under certain scenarios, super-csv will blow up when consuming special characters. To make this error appear:

      1. Copy/paste the following CSV data into an empty file:

       

      CONLANG, LOCAL

      ONE, 1

      TWO, 2

      THREE, 3

      FOURááçõ, 4

      # Save this file with encoding: UTF-16 Little Endian

      1. Try to parse the file with super-csv

      Here is the top stack trace I got while using it:

       

      {{MalformedInputException reading next record: java.nio.charset.MalformedInputException: Input length = 1-java.lang.IllegalStateException
      java.nio.charset.MalformedInputException: Input length = 1
      at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)
      at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:352)
      at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
      at java.base/java.io.InputStreamReader.read(InputStreamReader.java:181)
      at java.base/java.io.BufferedReader.read1(BufferedReader.java:210)
      at java.base/java.io.BufferedReader.read(BufferedReader.java:287)
      at java.base/java.io.BufferedReader.fill(BufferedReader.java:161)
      at java.base/java.io.BufferedReader.read(BufferedReader.java:182)
      at org.apache.commons.csv.ExtendedBufferedReader.read(ExtendedBufferedReader.java:58)
      at org.apache.commons.csv.Lexer.nextToken(Lexer.java:95)
      at org.apache.commons.csv.CSVParser.nextRecord(CSVParser.java:664)
      at org.apache.commons.csv.CSVParser$CSVRecordIterator.getNextRecord(CSVParser.java:142)
      at org.apache.commons.csv.CSVParser$CSVRecordIterator.hasNext(CSVParser.java:155)}}

      Let me know if there are any other details I can git to help!

      Attachments

        1. badcharacters.txt
          0.1 kB
          Draque Thompson

        Activity

          People

            Unassigned Unassigned
            draque Draque Thompson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: