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

Egor Vyscrebentsov wrote:
> On Thu, 24 Jan 2008 William Allen Simpson wrote:
>> 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!
>>From what I can see everyday, you're wrong. strlen() will return 70,
> while there are only, say, 40 multibyte characters.

(heavy sigh) You are confusing strings with characters.  They are not the
same....  Perhaps because of the unfortunately named "char" type, a 7-bit
signed integer.  They have *never* been the same.  Over my life, I've
programmed for 5-bit (Baudot code), 6-bit (CDC), 7-bit, 8-bit, 12-bit, and
now multi-byte characters.

For characters, we don't talk about "lengths", we talk about widths,
either in pixels or points.

> strlen() may be used to get size of string, but not length.
Perhaps there must be some Russian differences in the meaning of the words
size and length.  They are synonymous in English:

man 3 strlen

   strlen - find length of string

   size_t strlen(const char *s);

> Please note that I have mentioned server console. What should we use there?
Nothing.  No (translated or otherwise) message to the console needs to be
wrapped by the program.  That is handled by the console driver, as always,
since the days of paper tape!

It's truly sad that so much knowledge in the computer science field has
been lost because so many of our students only know M$windows. :-(

>> I propose removing wordwrap_string() everywhere.
> I disagree. However, I agree that we should not use this function for
> GUI clients. But it seems to me that you say about other problem than me.
I see them as all part of the same problem.

Freeciv-dev mailing list

Reply via email to