Binary package hint: cowsay
Ubuntu 9.04 cowsay 3.03
When piping text containing multibyte-characters to cowsay (echo "äöü" | cowsay), cowsay calculates line length based on the char* size, not the UTF-8-string size, resulting in this:
$ echo "ää" | cowsay ______ < ää > ------ \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || || $ echo "aa" | cowsay ____ < aa > ---- \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||
Note that the top bubble's size is off by 2 characters.
The length of lines must be determined using UTF-8 functions, not basic array functions to determine the screen real estate used.
Binary package hint: cowsay
Ubuntu 9.04
cowsay 3.03
When piping text containing multibyte- characters to cowsay (echo "äöü" | cowsay), cowsay calculates line length based on the char* size, not the UTF-8-string size, resulting in this:
$ echo "ää" | cowsay
||--- -w |
||--- -w |
______
< ää >
------
\ ^__^
\ (oo)\_______
(__)\ )\/\
|| ||
$ echo "aa" | cowsay
____
< aa >
----
\ ^__^
\ (oo)\_______
(__)\ )\/\
|| ||
Note that the top bubble's size is off by 2 characters.
The length of lines must be determined using UTF-8 functions, not basic array functions to determine the screen real estate used.