You are invited to Log in or Register a free Frihost Account!

Problem with displaying UTF character on my site

I am facing a strange problem. The content of the page when displayed in my localhost(PHP 4.4, apache 2, mysql 5.0) is displaying properly but when uploaded to my site, the characters bearing the dicritical marks are seen as garbled. I have included the screen shot of both below hoping for a solution. Please help.

PS. the situation can be directly viewed from

Thank you in advance.
If you fix all the errors reported by w3's validator. Then you should be ok. (or atleast you can start blaming a particular browser like IE7)
w3 validator check of your page

Good luck! PM me if you want help with a particular error.

BTW, I don't know for sure but this might not belong in this subforum.

Edit: looking closer at it you should escape the special chars too. php has a nice function for that:
Be aware though. It also converts < and > used for markup to &lt; and &gt;
I am also sugest to validate your html. There is maybe few mistakes:
1. You need to define DOCTYPE, for example:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" xml:lang="hr" lang="hr">
<title>SOME TITLE</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

2. Check are your DB (if you are use MySql) saved in UTF mode.
3. If you are using some script editor be sure your encoding type are seted and saved on UTF-8 w/o BOM

For the temporary resolution, I have included the line
mysql_query('set character set utf8;'); to my connection script and that solved the problem for those data that are fetched from database( Although I set the database to UTF general ci, while creating it). May be it is php 5 which is imposing this restrictions.

Regarding HTML part, I had to use special character sequence according to your suggestions ( eg & # 233; for and so on). Now it is displaying more or less correctly.

But in my localhost , it was displaying without any of these modification and I still fail to understand the reason. Very Happy
I think this is problem in your php editor. Your tastature and computer is setted on right displaying and when your type in your editor you are get good results. But hosting and other computers are not setted on utf-8 codding. I am using Crimson editor for all my sites. For text what I am typing I need to set encoding type UTF-8 w/o BOM. If I forget to set it or if I copy some text from other document then I change ecnoding type after but for reloading I need to click NO.

Thank you Sonam.
Actually I am using PHP designer 2008 professional to write the PHP code. Surely the difference between the environments in two servers, is causing the problem. I have also tried with notepad++ which has the facility of writing without as well as removing the BOM objects. But that didnot help either. May be we are still not ready for the completely compatable utf environments. Sad
May be we are still not ready for the completely compatable utf environments.

Yeah, I think you are right. Sad

How are the characters in the database?
In the database, as I have mentioned earlier, the characters are perfectly displayed(when opened with phpmyadmin).
Related topics
What happend with my name??
weird banner thing
How Do You Center Your Entire Web Page?
Explain and get up to 30FRIH!
do you use e-messenger?
some people can't acces my site
My account is down...
[OFFICIAL] Favourite/Best CMS
See what you think to my site?
Domain Problem
Vista problem?? can someone help me out??
Problem With Web sites?
can not open my site with firefox..
search, a bit contextual in php
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

© 2005-2011 Frihost, forums powered by phpBB.