input: handle UTF-8 terminal input
commit7ea5c4c26c9c47639a1962385d9cacd531ba8466
authorwm4 <wm4@mplayer2.org>
Fri, 13 Jan 2012 06:59:21 +0000 (13 07:59 +0100)
committerUoti Urpala <uau@mplayer2.org>
Sun, 25 Mar 2012 19:30:37 +0000 (25 22:30 +0300)
tree4f11ab7c989d9ed982acd4adff6a6004b72c35f2
parent166a7de4cf94a78c34040b47a929a72d12f2945f
input: handle UTF-8 terminal input

This assumes the terminal uses UTF-8. If invalid UTF-8 is encountered (for
example because the terminal uses a legacy encoding), the code falls back
to the old method and feeds each byte as key code to the input code.

In theory, UTF-8 input could randomly fail, because the code in getch2.c
doesn't try to fill the input buffer correctly with input sequences
longer than a byte. This is a problem with the design of the existing
code.
osdep/getch2.c