tags:

views:

77

answers:

4

hello,

am trying to show an arabic meta tags, but when ever i load the page, and i view the source it shows some garbage.

and this is what i did so far. this is my config.php file

define("GAMES_META_DESCRIPTION",   "بيسبي");

and this is my header file

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml" lang="ar" xml:lang="ar">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<meta http-equiv="Content-Language" content="ar-sy">
<meta name="description" content="<?=htmlentities($meta_description);?>">
</head>

any help with be rewarded with a cookie :)

+1  A: 

Make sure that both your PHP and your header files are the same encoding. Preferably UTF-8.

Delan Azabani
+1  A: 

ok I don't know for what you need meta description? it is not useful. Anyway I recommend use UTF8. file have to be saved as utf8 and meta:

<meta http-equiv='content-Type' content='text/html; charset=UTF-8'/>
jatt
A: 

I agree. Use:

<meta http-equiv="content-Type" content="text/html; charset=UTF-8" />

With double quotes and a space before /> (I know I'm picky, but that's as far as I know the standard way to do it.)

One upside with using UTF-8 is that you almost never have to replace special characters, like the Swedish letter å, with HTML entites (in the case of å, &aring;).

Also, I disagree with the comment above that meta descriptions aren't useful. On the contrary, I find meta descriptions very useful, mainly because they appear often enough in results from google searches.

matsolof
+1  A: 

Did you try using plain arabic characters instead of using a function e.g meta name="description" content="بيسب"

probably the problem is in your function itself not encoding.

wael34218
yes the problem was my function.
saadlulu