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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
DeButler
Forum Newbie
Posts: 2
Joined: Wed Jan 16, 2008 4:05 am

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

Post 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?
www.WeAnswer.IT
Forum Newbie
Posts: 24
Joined: Wed Mar 19, 2008 6:33 pm

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

Post 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
Post Reply