* Askar Safin <safinas...@mail.ru>, 2014-11-16 07:06:
Steps to reproduce:
* Install gpm and console-cyrillic
* Configure console-cyrillic and choose terminus unicode bold as a font
* Restart console-cyrillic
* Type Russian letters "а" and "о" (which look exactly same as English "a" and 
"o")
* Copy them to clipboard using gpm
* Paste

What I get:
* I get English "a" and "o"

What I expected to get:
* Russian "а" and "о"

This is not a gpm bug. Gpm is not deeply involved in the copying and pasting operation: it just tells the kernels what part of screen to copy and when to paste.

What your seeing is caused by limitations of the Linux kernel and a font design choice:

1. The kernel limits the number of glyphs in the font to 256 (or 512 if you're OK with reduced number of available colors).

2. To work around this limit, and to fit as many characters as possible into a single font, the Terminus fonts reuses the same glyphs for characters that look the same (or almost the same), such as Latin "a" and Cyrillic "а".

3. The kernel didn't track which Unicode _characters_ appeared on screen, only which _glyphs_ did. (So the distinction between Latin "a" and Cyrillic "а" got lost.)

Fortunately, the last point is partially fixed since v4.19:
if you read from a /dev/vcsuN device, the kernel will start to keep track of Unicode characters on screen, and they should be properly copy-pastable.

See the following kernel commits:
https://git.kernel.org/linus/9bfdc2611d417be453c3deb7a7ef2ffc718febfa
https://git.kernel.org/linus/d21b0be246bf3bbf569e6e239f56abb529c7154e

--
Jakub Wilk

Reply via email to