Merge: lib/core: provide default codec-aware read_char
Previous implementations of read_char were unaware of codec issues, and
used to read a byte and convert it to a code point.
For ASCII characters this was enough, but once unicode characters were
read on a char-by-char basis, wrong characters would appear.
This commit fixes this issue by using the Codec API to read a character
intelligently, and properly support multibyte encodings.
Signed-off-by: Lucas Bajolet <lucas.bajolet@gmail.com>
Pull-Request: #2648
Reviewed-by: Jean Privat <jean@pryen.org>