Home  |  Linux  | Mysql  | PHP  | XML
From:David Kaufman Date:Tue May  6 17:52:19 2008
Subject:Re: Stripping out Unicode combining characters (diacritics)
Hi Michael,

"Doran, Michael D" <doran@uta.edu> wrote:

> I'm trying to strip out combining diacritics from some form input using 
> this code:
> [...]
> $sans_diacritics  =~ s/\p{M}*//g;

I do it like this:

use Encode;
use Unicode::Normalize qw(normalize);

my $ascii = encode('ascii', normalize('KD', $utf8), sub { $_[0]='' });



Navigate in group perl.i18n at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants