Add stripAccents to KStringHandler

Thiago Macieira thiago at kde.org
Thu Oct 18 08:53:06 BST 2007


Em Thursday 18 October 2007 04:05:16 Frederik Gladhorn escreveu:
> I would like to add one function to KStringHandler which will be used to
> remove accents from QStrings.
>
> This includes all sorts of char variations. "Häáàâllo" will become
> "Haaaallo".
>
> At this moment KHangMan has code like this to do the same with a list of
> accent chars hardcoded. The list is incomplete and not very reliable.
> Adding support for new languages requires code changes to handle special
> characters right now. This can be avoided by using the unicode functions.
> The same applies to Kanagram.
>
> Parley uses the attached method to give feedback for accent mistakes.
>
> The KStringHandler class seems to be the right place for the function.
> Since it only adds a function it is binary compatible.

It seems awfully specific for a method in KStringHandler. It's very simple to 
do it using NFD just like you did in your patch.

And I fear that adding a "noAccents" (actually, no combining symbols, which 
have other markers that aren't accents) function will trigger people trying 
to compare "no accent" versions of strings, which is incorrect for some 
locales.

-- 
  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/40b441bf/attachment.sig>


More information about the kde-core-devel mailing list