metaeducation/ren-garden

UTF8 encoding may be half-flushed

Opened this issue · 0 comments

The iostream-based hook for RenCpp is character encoding agnostic, and is just sending a stream of UTF8 encoded characters. The custom iostream for FakeStdio which accepts this buffer flushes it to the graphical console. However, that flush needs to actually look at the buffer and ensure it writes entire characters.

As it is written, if you're unlucky (and using actual Unicode instead of just the ASCII subset of UTF8) you'll wind up putting a malformed string in the terminal.