perl-unicode

Caseless and accentless string comparisons

2003-05-11 20:30:05

I am writing a perl module that can take a name as an argument to look
up the namedays for the name.  However, I would like to be able to do
a caseless and accentless comparison on the names.  The caseless part
is pretty simple, I can just lc both (since lc is safe in Unicode
rather than uc which may get odd with titlecase).

What is the equivalent transformation to remove accents?  perluniintro
says that you should do that in some cases, but doesn't say how.  I
have poked around a bit and nothing springs out at me.  Is there a
preferred way to do this?  Should I decompose the string then remove
the accent characters?  This seems really kludgy so there must be a
better way.

       Thanks,

           -ben