Replacing accented characters

Hey all,

Does anyone have a function that replaces accented characters
with the non-accent equals?

I can't figure out how to get them out of the Ubuntu keyboard
the way it is configured so I've just tried three different
functions off the Internet and none of them have worked.

Thanks,
Skip
--
====================================
Skip Evans
PenguinSites.com, LLC
503 S Baldwin St, #1
Madison WI 53703
608.250.2720
http://penguinsites.com
------------------------------------
Those of you who believe in
telekinesis, raise my hand.
-- Kurt Vonnegut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Skip Evans [ Do, 04 März 2010 18:57 ] [ ID #2034050 ]

Re: Replacing accented characters

--=-3ZzvNUD+oMVV9nR9E+Fg
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Thu, 2010-03-04 at 11:57 -0600, Skip Evans wrote:

> Hey all,
>
> Does anyone have a function that replaces accented characters
> with the non-accent equals?
>
> I can't figure out how to get them out of the Ubuntu keyboard
> the way it is configured so I've just tried three different
> functions off the Internet and none of them have worked.
>
> Thanks,
> Skip
> --
> ====================================
> Skip Evans
> PenguinSites.com, LLC
> 503 S Baldwin St, #1
> Madison WI 53703
> 608.250.2720
> http://penguinsites.com
> ------------------------------------
> Those of you who believe in
> telekinesis, raise my hand.
> -- Kurt Vonnegut
>


Ubuntu should have gucharmap which should let you copy and paste
accented characters.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--=-3ZzvNUD+oMVV9nR9E+Fg--
Ashley Sheridan [ Do, 04 März 2010 18:54 ] [ ID #2034051 ]

Re: Replacing accented characters

On Thu, Mar 4, 2010 at 12:57, Skip Evans <skip [at] bigskypenguin.com> wrote:
> Hey all,
>
> Does anyone have a function that replaces accented characters
> with the non-accent equals?

This one by Sven on 21-APR-2005:

<?php
function transcribe($string) {
$string = strtr($string,
"\xA1\xAA\xBA\xBF\xC0\xC1\xC2\xC3\xC5\xC7
\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\xD0\xD1
\xD2\xD3\xD4\xD5\xD8\xD9\xDA\xDB\xDD\xE0
\xE1\xE2\xE3\xE5\xE7\xE8\xE9\xEA\xEB\xEC
\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF8
\xF9\xFA\xFB\xFD\xFF",
"!ao?AAAAAC
EEEEIIIIDN
OOOOOUUUYa
aaaaceeeei
iiidnooooo
uuuyy");
$string = strtr($string, array("\xC4"=>"Ae", "\xC6"=>"AE",
"\xD6"=>"Oe", "\xDC"=>"Ue", "\xDE"=>"TH", "\xDF"=>"ss", "\xE4"=>"ae",
"\xE6"=>"ae", "\xF6"=>"oe", "\xFC"=>"ue", "\xFE"=>"th"));
return($string);
}
?>

If you search via Google for 'php accented characters function'
you'll see some user notes with code samples. I grabbed the one above
from strtr() on php.net, and there are several others there and other
places --- like on the preg_replace() page, if memory serves.


--
</Daniel P. Brown>
daniel.brown [at] parasane.net || danbrown [at] php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Looking for hosting or dedicated servers? Ask me how we can fit your budget!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Daniel Brown [ Do, 04 März 2010 19:07 ] [ ID #2034052 ]
PHP » gmane.comp.php.general » Replacing accented characters

Vorheriges Thema: PHP 5.3.2 released!
Nächstes Thema: Entry-Level Slot Available in Denver