rootvector2 opened a new pull request, #615:
URL: https://github.com/apache/commons-csv/pull/615

   `ExtendedBufferedReader.read()` feeds the `EOF` sentinel (`-1`) to 
`getEncodedCharLength` when `trackBytes` is on, narrowing it to `(char) -1` 
(`U+FFFF`) and pushing it through the charset encoder. A single-byte charset 
like `ISO-8859-1` or `US-ASCII` cannot encode `U+FFFF`, so byte tracking throws 
`UnmappableCharacterException` at end of input on an otherwise valid file; with 
`UTF-8`/`UTF-16` it silently adds a few phantom bytes to the count. Found while 
running `getBytePosition` with a non-UTF charset; the `read(char[], off, len)` 
overload already guards this with `len > 0`, so this mirrors that guard for the 
single-char path.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to