[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-XBoard] [bug #35181] Shortened menunames in tinymode not transl

From: Byrial Jensen
Subject: Re: [Bug-XBoard] [bug #35181] Shortened menunames in tinymode not translated
Date: Tue, 27 Dec 2011 23:44:44 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20111109 Thunderbird/3.1.16

Den 27-12-2011 23:36, Tim Mann skrev:
 > (copying the tranlated item names to a buffer, and zeroing a byte in
it based on the board width
 > through an emperically derived linear formula that worked for English
before sending it to the X-server).

If the item name is in UTF-8, doing that blindly can leave you with an
invalid UTF-8 character at the end of the truncated string. In fact you
might end up with no valid characters, just one invalid one.

Yes, as said before in this thread you have to use the C99 function mbtowc() or some library dedicated to handle multibyte char strings.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]