zaggs — 2010-12-16T06:08:27-05:00 — #1
I am having a problem with Portugese language on this site. On some pages the characters display fine, like here: http://www.universodosdominios.com/index.php (category menu down left).
However, when I go to this page, the same menu items do not appear correctly: http://www.universodosdominios.com/search.php?mode=advancedsearch
The charset is the same on both pages. What could cause this?
anthonysterling — 2010-12-16T06:19:19-05:00 — #2
How is the code different between the two entry points?
Your server sends the same headers for both...
HTTP/1.1 200 OK
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Date: Thu, 16 Dec 2010 12:15:04 GMT
Server: Apache/2.2.3 (CentOS)
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
zaggs — 2010-12-16T06:22:55-05:00 — #3
The code that displays the categories is exactly the same function...
chris_upjohn — 2010-12-16T06:23:19-05:00 — #4
Placing those kinds of characters into a page isn't ASCII compliant, you will need to replace the symbols with HTML symbol codes for them to render correctly.
aleksejs — 2010-12-16T06:28:56-05:00 — #5
My wild guess is that in second page when extracting categories from DB, you have not executed "SET names UTF8"., because if I forcibly change encoding in browser to ISO-8859-1, then diacritical characters seem to appear.
anthonysterling — 2010-12-16T06:34:14-05:00 — #6
Have you ensured the character encoding for the 2 physical files are the same?
zaggs — 2010-12-16T06:49:16-05:00 — #7
I resolved the issue by using:
$dbh->query("set names 'utf8'");
Thanks for your help guys!
aleksejs — 2010-12-16T07:24:45-05:00 — #8
Yes! My crystal ball was the most accurate!