First two patches can be applied. The second patch is not mine, I just
cherry-picked it from wchar branch.

Third patch changes internal representation in Glyph and makes it work.
Fourth patch changes some functions mostly in the way already done in
wchar branch.

The general idea is to decode UTF-8 when reading from tty or
clipboard and encode to UTF-8 when writing to terminal or clipboard.

One problem is CSI and STR sequences. Now they are stored encoded to
UTF-8 and i am not sure it should be changed because it makes it
possible to use atoi to parse arguments.  So tputc still encodes the
character that was decoded a bit earlier.

However, the code becomes simplier this way, lots of ugly '.c[0]' are
replaced by '.u' and utf8len is removed. I think these patches can
already be applied.

Reply via email to