dexador icon indicating copy to clipboard operation
dexador copied to clipboard

unread-char for decoding-stream broken for multibyte encodings

Open fboundp opened this issue 7 years ago • 0 comments

In STREAM-READ-CHAR, the first value returned from the BABEL:CODE-POINT-COUNTER function was used to track LAST-CHAR-SIZE (the number of bytes consumed while reading a character). However, it is actually the number of characters decoded, and for this particular call, it is always 1. As a result, a later STREAM-UNREAD-CHAR of a multibyte character will cause BUFFER-POSITION to point into the middle of the encoded byte sequence, ultimately leading to a decoding error.

added a fix in https://github.com/fukamachi/dexador/pull/38

fboundp avatar Aug 12 '17 23:08 fboundp