Which different widths of code points regarding the print column do exist, supposed an `a` has width of print column `1`?

StackOverflow https://stackoverflow.com/questions/11598364

質問

Which different widths of code points regarding the print column do exist, supposed an a (\N{LATIN SMALL LETTER A}) has width of print column 1?

Edit:

"print column width" refers to the output to a terminal

役に立ちましたか?

解決

In Unicode, characters can be nonspacing (0 columns), narrow (1 column) or wide (2 columns). You can get the number of columns a string would take using the method columns from GCString, or mbswidth from Text::CharWidth.

Of course, this only works for monospaced output, e.g: output to a terminal.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top