Re: [PATCH 1/2] libgit.a: add some UTF-8 handling functions
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Dec 22, 2006, 22:20 UTC
- Message-ID
- <Pine.LNX.4.63.0612222319230.19693@wbgn013.biozentrum.uni-wuerzburg.de>
- In-Reply-To
- <7vpsabwq34.fsf@assigned-by-dhcp.cox.net>
Hi,
On Fri, 22 Dec 2006, Junio C Hamano wrote:
Show 18 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > >> If you do wrapped_text, I think you do not _want_ strlen (the > >> definition to me of strlen is "number of characters in the > >> string"). What you want is a function that returns the number > >> of columns consumed when displayed on monospace terminal. > > > > To me, characters are the symbols occupying one "column" each. Bytes are > > the 8-bit thingies that you usually use to encode the characters. > > I cannot tell from your reponse if you are very well aware of > Asian "double-width" characters and your version of strlen() > counts one such character as two, or if you are totally unaware > about the issue and your function returns 1 for a string that > consists of a single such character. > > If the former, then the function is not strlen() anymore, and if > the latter, then it is unusable for wrapping purposes.
The latter. Oh, well. Call me a Western idiot.
And scrap that patch.
Ciao, Dscho