[pacman-dev] [Bug] using strlen with utf8

Pierre Schmitz pierre at archlinux.de
Wed Feb 14 07:17:47 EST 2007


Hi,

it seems as if the function strlen only counts the number of bytes within a 
given string and not the number of characters. In case of utf8 a character 
can have a length of one or two bytes.

The attached screenshot show that in trans.c:337 the length is calculated 
wrong (because he counts the ü twice). When replacing ü with ue everything is 
right.

Pierre

-- 
http://www.archlinux.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pacman-utf-bug.png
Type: image/png
Size: 10425 bytes
Desc: not available
URL: <http://archlinux.org/pipermail/pacman-dev/attachments/20070214/2485c382/attachment.png>


More information about the pacman-dev mailing list