문제

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! :)

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top