<URL: http://bugs.freeciv.org/Ticket/Display.html?id=40043 >

Egor Vyscrebentsov wrote:
> At least in utility/shared.c:wordwrap_string() strlen() is used to
> determine number of characters in the string. This gives wrong result
> on multibytes encoding.
The issue is not strlen().  It is properly used to determine the
length of a string.  The issue is that strlen() has nothing to do with
how much room there is for display in a particular window!

This abuse of strlen() would have been considered a stupid bug as far
back as the techtronix green screen in the '70s!!!  Or the DECwriters we
all used for C programming back then.  Let alone modern i18n....

The messages should be wrapped in the clients by their respective GUI code,
such as gtk-text-set-word-wrap, XawtextWrapWord, etc.

(easy Google of examples)

I propose removing wordwrap_string() everywhere.

Freeciv-dev mailing list

Reply via email to