Boxes instead of arabic characters

Hello everybody,

my client just told me that he sees only “boxes” instead of arabic characters when viewing our new site in “the latest version of Internet Explorer”. I am unable to reproduce this error, however. Can anybody suggest a reason for this or tell me how to fix it?

Thanks a lot for any feedback.

As it looks as though it is in UTF-8; is it possible that they don’t have the correct fonts/language pack installed on their system or have their browser not using the correct encoding.

You are using text going from right to left in UTF-8, but still it should work. Arabic encoding (ISO-8859-06) maybe try that on a very simple RTL demo page with plain ASCII text and ask them if that cures things.

Also forgot to mention you should have:

<html xmlns=“http://www.w3.org/1999/xhtml” xml:lang=“ar” lang=“ar”>

Better still this might help; http://www.w3.org/International/tutorials/bidi-xhtml/ I’d be interested in which solution you find works though.

It should also be said that it’s how the pages are served that defines character encoding. It’s the data that is sent with the request and headers that are sent that need to be in UTF-8.

Looking at the content-type header in the Response headers it doesn’t look like this is how they pages are being served.
Content-Type: text/html
Not
Content-Type: text/html; charset=utf-8

Because you are using PHP try adding this to the top of the page.


<?php
   header('Content-Type: text/html; charset=utf-8'); 
?>

and see if that fixes it.

Hope it helps :slight_smile:

I checked the site in Opera (using the Info tab on the left) and it suggests that the page is being serves as utf-8 by the server.

Sometimes if I copy text from a text editor that is not encoded as utf-8 the characters don’t display properly, even if the page is served as utf-8 (I was helped recently with this issue here: http://www.sitepoint.com/forums/showthread.php?t=648930). Don’t know if this is your situation, though.

Hmm, Not 100% sure but I think the page info in browsers would show the computed encoding - that would take into account content-type headers, meta and the characters themselves.

I was using the web developer toolbar’s Information > Response Headers as the source of truth.

Most probably the user who is having trouble is using IE6, where it needs to be told explicitly a few times :wink:

Is the issue only with IE8? Since he’s getting boxes, and if the problem is with all browsers, it is likely he does not have Arabic fonts on his machine. If it IE only, and if the browser is configured to something other than utf-8, he should still be getting printable characters; just not the right characters. Without more trouble shooting on his machine it’s all guesswork.

On a side note, the Arabic font has such a low aspect ration (en height ÷ em height), it is very hard on the eyes. I’d suggest going at least 50% larger.

cheers,

gary

I was going on Tommy Olsson’s comment in the post I linked to above:

Opera’s Info panel will also show you the encoding sent by the server for any page.

I was using the web developer toolbar’s Information > Response Headers as the source of truth.

Interesting. I’ll try that too.