OK, I cannot understand what the problem is. Here's my example:
Code PHP:
How come? The locale is set, but I still get those ?'s for some reason. Could it be a problem of my OS (CENTOS Enterprise 4.7)? The PHP version is 5.2.6.
| SitePoint Sponsor |


OK, I cannot understand what the problem is. Here's my example:
Code PHP:
How come? The locale is set, but I still get those ?'s for some reason. Could it be a problem of my OS (CENTOS Enterprise 4.7)? The PHP version is 5.2.6.

The incorrect or missing html character setting on the browser (or whatever), or webpage displaying the output?
I've never used iconv so this might not be correct, but you might need to change the encoding in the html or response headers. Also, try using 'iso-8859-1' instead of 'ascii//translit'
Find freelance jobs from all the major sites in one place:
on twitter / on the web / twitter rss feed


Guys, HTML/response headers has nothing to do with the problem. It's not my browser that doesn't display the characters - iconv function itself outputs ?'s. Besides, ISO-8859-1 is not what I need at all. I need to transliterate the string.
The interesting thing is that on one of my servers the same works just fine (CENTOS Enterprise 5.2 x86_64), but on the other it doesn't (CENTOS 4.7 i686). It even works on my Vista laptop...

Well, I said browser but it could just as easily be a setting in your editor ( or your os)
What encoding is your php source file saved in?
Me thinks it better be utf8 otherwise it won't work(it contains a utf8 string).


It is utf-8 encoded.
What does this tell you on the problem server?
PHP Code:var_dump(setlocale(LC_ALL, 'en_US.utf8'));


The locale 'en_US.utf8' IS supported by the server. It's one of those returned by the 'locale' command.
Bookmarks