Add stripAccents to KStringHandler

Thiago Macieira thiago at kde.org
Thu Oct 18 13:08:51 BST 2007


Em Thursday 18 October 2007 12:34:32 Frederik Gladhorn escreveu:
> Of now four programs benefiting from this (add Marble as it seems) no dev
> knew about it. And I wonder how many other apps could use this for search
> fields and maybe in other places.

I'm still skeptical about this kind of matching. I'd rather each application 
wrote the function that is specific for their needs.

In the specific case of Parley, "getting the accents wrong" isn't enough. You 
have to match other language specificities: for instance, in German, ö is the 
same as "oe" and ß is the same as "ss" (but not in all cases, AFAIU), but ß 
isn't the same as β (Greek Beta). The function you wrote will not catch any 
of those cases, so you still need to do some decomposition on your own.

Also, did you know that the function you wrote will strip the Hebrew vowel 
accents? In the case of Parley, I think this might be relevant.

By providing this function in KStringHandler, you open up room for lazy 
coding: the developer didn't really think through the issue.

PS: in any case, suggestions:
  add a noAccents.reserve(original.length());
  also match QChar::Mark_SpacingCombining and QChar::Mark_Enclosing
   (some Bengali vowel signs are non-spacing others are spacing)

PPS: NFKD normalisation turns ß into ss, DZ into D and Z, etc.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20071018/ed9030f4/attachment.sig>


More information about the kde-core-devel mailing list