Column widths are broken for non-latin characters in console

29 Views Asked by At

I have this rather inconvenient problem with mysql console client, the column widths in display are broken for non-latin characters, i.e. mysql makes the column 1.5 times wider than it needs to be for Chinese characters, Cyrillic is even worse, the column is twice as wide as it needs to be, i.e. for a string 100 characters wide, the column width will be 200 characters which makes the output absolute mess really. Is there a way to fix this? I tried to use -r -s and \P but I could not get anything suitable.

See the example below, note how abc column is exactly as wide as the string RRRRRRR plus two margin characters, and how zh and cyr are incorrectly padded as if the input contained invisible spaces.

 select '你好你好' as zh, 'RRRRRRR' as abc, 'ЯЯЯЯЯЯЯ' as cyr;
+--------------+---------+----------------+
| zh           | abc     | cyr            |
+--------------+---------+----------------+
| 你好你好     | RRRRRRR | ЯЯЯЯЯЯЯ        |
+--------------+---------+----------------+
0

There are 0 best solutions below