bug-gnulib
[Top][All Lists]
Advanced

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

wcwidth replacement problems


From: Alexander V. Lukyanov
Subject: wcwidth replacement problems
Date: Sat, 23 Aug 2008 13:12:07 +0400
User-agent: Mutt/1.5.11

Hello!

I'm trying to use wcwith replacement on Solaris 8 and have noticed some
problems. At first, the test for replacement did not detect the problem and
thus did not replace the system function (patch for this is attached). Then
I have noticed that the replacement function is slow and broken.

At least rpl_wcwidth(0x00AB) returns 0, but it should return 1 for the 
character.
0x00AB is LEFT-POINTING DOUBLE ANGLE QUOTATION MARK.

Note that rpl_wcwidth(0x00BB) returns 1 properly. 0x00BB is the companion char
RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK.

The slowness is probably caused by checking the charset string every time
wcwidth is called. I'm not sure which way to fix it would be correct, probably
caching the check result will help.

BTW, why not use this one: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c ?
It's public domain.

-- 
   Alexander.

Attachment: diff
Description: Text document


reply via email to

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