Page 1 of 1

Can't find/replace the character ó (o acute)

Posted: Thu Mar 13, 2008 4:11 am
by DeButler
Hi,

I'm having some trouble with the character ó. I want to replace ó with ó and I'm trying to do this like this:

Code: Select all

 
$value = "Po?ó? góry";
$value = str_replace('ó','ó',$value);
 
This won't fly however... the character can't be found using strpos either.

Any ideas?

Re: Can't find/replace the character ó (o acute)

Posted: Wed Mar 19, 2008 8:15 pm
by www.WeAnswer.IT
PHP is very stupid when it comes to characters that aren't used in English very often. They're fixing it in PHP6, though.

I tried your code and it works for me with PHP 5.2.5. I encoded my PHP file as Unicode when I was saving it.

Long article about unicode support in PHP, which could help you a lot: http://acko.net/blog/unicode-in-php

PHP functions that might help you also: http://php.net/mbstring