Re: Replacing accented characters by non-accented characters

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

 



Thanks James,

That would probably work out if it wasn't too dependent on the locales
to work. I'm developing an open-source product which could end up on a
server without the locales for French but be used by some French people,
which would make (as far as I can get out of one comment from Richie in
the PHP manual) the transliteration somewhat wrong.

The dependency on iconv is also a minor problem to me as we are rather
using MB at the moment, but I guess I might find something similar in MB
anyway.

Thanks,

Yannick


Le lundi 12 mai 2008 à 16:28 +0100, James Dempster a écrit :
> oops wrong way round
> echo iconv('UTF-8', 'ISO-8859-1//TRANSLIT', 'français');
> 
> On Mon, May 12, 2008 at 4:27 PM, James Dempster <letssurf@xxxxxxxxx> wrote:
> 
> > maybe try iconv (http://uk.php.net/manual/en/function.iconv.php)
> > e.g.
> >
> > echo iconv('ISO-8859-1', 'UTF-8//TRANSLIT', 'français');
> >
> > --
> > /James
> >
> >
> > On Mon, May 12, 2008 at 4:09 PM, Yannick Warnier <ywarnier@xxxxxxxxxxxx>
> > wrote:
> >
> > > Hello,
> > >
> > > I've been trying to find something nice to transform an accentuated
> > > string into a non-accentuated string. Obviously, I'm mostly playing
> > > inside the European languages, but any method that could transform
> > > arabic or asian characters to plain non-accentuated characters would be
> > > perfect.
> > >
> > > I have found a number of solutions, ranging from str_replace() for every
> > > known accentuated character to strtr() to a preg_replace() of a
> > > conversion of the string to html characters then removing the "&" and
> > > the "alteration" string (acute, grave, circ, ...).
> > >
> > > I must say the last one seems to work better because it's less affected
> > > by charset changes, but it still seems awfully slow to me and I would
> > > like to know if there is any function that exists that could do that for
> > > me?
> > >
> > > Yannick
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> >


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux