Egmont Koblinger asked:
> - Where can I find specification about the terminal width of each and every
> Unicode character?

http://www.unicode.org/reports/tr11/ and the Unicode character database 4.1.

> - Is glibc's wcwidth() considered to be a good implementation?

Yes. Note that for characters with ambiguous width (where the width is 1
in European contexts and 2 in Japanese contexts) it returns 1.

> What about
> the cases where it returns -1, including U+0603 mentioned above?

-1 is returned for control characters and similar, where the cursor
movement is not predictable.

> - Is it clearly a bug in the terminal emulator (gnome-terminal/vte) if it
> moves the cursor for a character whose wcwidth is zero? (I guess it is, and
> I found it in gnome's bugzilla as #162262.)

Yes. A terminal emulator is supposed to display these zero-width and
combining characters in a way that doesn't move the cursor.

> - Is it documented somewhere what a terminal emulator should do if it
> receives a character whose wcwidth equals to -1?

These are control characters. For some, like U+000A, the semantics is
clear; for others, it is unknown.

> - What shall a terminal emulator do with the cursor position if it receives
> a character that is not assigned and known that won'be assigned

Undefined behaviour.

> or when it receives a character that is not yet assigned?

It should assume that it is a normal graphic characters whose width is
1, 2, or 0, depending on the numeric code of the character. For example,
the characters U+20000..U+2FFFD and U+30000..U+3FFFD all have width 2,
although many of them are not yet assigned.

Bruno


--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to