views:

21

answers:

1

test.php - Using regular IDE(phpDesigner7)

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>

<?php
      echo "بوغاليا";
?>

</body>
</html>

output : ???????


test.html - Using regular IDE(phpDesigner7)

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
بوغاليا
</body>
</html>

output : ???????


test.html - Using Arabic Pad

<head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
بوغاليا
</body>
</html>

output : بوغاليا


hello.php - Using Arabic Pad

<?php 
 echo "Hello";
 ?>

output : Nothing

I am running a local WAMP(PHP 5.3). From this.
I have tried saving these pages with : charset=utf-8 as well on both the programs with no luck.

I know for fact that my IDE can't handle special characters and the other program that Can handle special characters can write workable HTML but if PHP files are written in it, It will not work. I know this is an encoding issue(in the IDE and while displaying the pages).

How does one go about displaying special characters with PHP code, I have large chunks of this arabic text that needs to be displayed.

Do you know how is this done?

Thanks! :)

+3  A: 

Why are you setting your charset to iso-8859-1? That's Latin-1. You can't render non-Latin characters in Latin-1.

Try using UTF-8 instead.

Borealid
The actual issue was with the encoding done by the IDE. Changed the settings in the IDE from ANSI to UTF-8. This Solved the problem. thanks!
DMin