Although the keyboard (keyboard.c) and terminal (vt.c) both have "UTF-8
modes", there are still a couple of short-comings at the kernel level.
* compose tables use 8-bit characters,
* selection doesn't copy/paste UTF-8.
(OK, so there are many more, but these two are the ones that make
it inconvenient to even use extended Latin characters.)
Here is a patch against 2.5.70 that fixes selection. It uses the
existing Unicode font information (ushorts) to create an inverse mapping.
Chris
--------_3ED8A3BF557D04F17FC0_MULTIPART_MIXED_
Content-Type: application/octet-stream; name="selection.patch"
Content-Disposition: attachment;
filename="selection.patch"
Content-Transfer-Encoding: base64
LS0tIGEvaW5jbHVkZS9saW51eC9jb25zb2xlbWFwLmgJMjAwMy0wNS0wNCAxOTo1Mzo1Ni4wMDAw
MDAwMDAgLTA0MDAKKysrIGIvaW5jbHVkZS9saW51eC9jb25zb2xlbWFwLmgJMjAwMy0wNS0yNiAx
NToxNzo0NS4wMDAwMDAwMDAgLTA0MDAKQEAgLTEwLDYgKzEwLDYgQEAKIAogc3RydWN0IHZjX2Rh
dGE7CiAKLWV4dGVybiB1bnNpZ25lZCBjaGFyIGludmVyc2VfdHJhbnNsYXRlKHN0cnVjdCB2Y19k
YXRhICpjb25wLCBpbnQgZ2x5cGgpOworZXh0ZXJuIHUxNiBpbnZlcnNlX3RyYW5zbGF0ZShzdHJ1
Y3QgdmNfZGF0YSAqY29ucCwgaW50IGdseXBoLCBpbnQgdXNlX3VuaWNvZGUpOwogZXh0ZXJuIHVu
c2lnbmVkIHNob3J0ICpzZXRfdHJhbnNsYXRlKGludCBtLGludCBjdXJyY29ucyk7CiBleHRlcm4g
aW50IGNvbnZfdW5pX3RvX3BjKHN0cnVjdCB2Y19kYXRhICpjb25wLCBsb25nIHVjcyk7Ci0tLSBh
L2RyaXZlcnMvY2hhci9jb25zb2xlbWFwLmMJMjAwMy0wNS0wNCAxOTo1MzozNi4wMDAwMDAwMDAg
LTA0MDAKKysrIGIvZHJpdmVycy9jaGFyL2NvbnNvbGVtYXAuYwkyMDAzLTA1LTI2IDE1OjAxOjU4
LjA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bF9lbmQ7IGkgKz0gMikg
ewotCQkqYnAgPSBzZWxfcG9zKGkpOwotCQlpZiAoIWlzc3BhY2UoKmJwKyspKQorCQljID0gc2Vs
X3BvcyhpKTsKKwkJaWYgKHVzZV91bmljb2RlKQorCQkJYnAgKz0gc3RvcmVfdXRmOChjLCBicCk7
CisJCWVsc2UKKwkJCSpicCsrID0gYzsKKwkJaWYgKCFpc3NwYWNlKGMpKQogCQkJb2JwID0gYnA7
CiAJCWlmICghICgoaSArIDIpICUgdmlkZW9fc2l6ZV9yb3cpKSB7CiAJCQkvKiBzdHJpcCB0cmFp
bGluZyBibGFua3MgZnJvbSBsaW5lIGFuZCBhZGQgbmV3bGluZSwK
--------_3ED8A3BF557D04F17FC0_MULTIPART_MIXED_--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/