Jump to content

Problem With Persian (فارسی) Lang In Php


japapa

Recommended Posts

Hi. I have some problem with php

when i try to write a php(or html) that have unicode chars and upload it on host all of chars convert to ? mark when i show it in the mozilla , opera or other browsers

i save the php with utf-8 encoding and set the page encoding to utf-8 but i can't slove this problem

you can see an example here

http://farachat.tk/test.php

 

soure code: http://farachat.tk/tes.htmlwhat i should do?

 

please Help me

Sorry for my bad english :(

  • Like 1
Link to comment
Share on other sites

<p>i try this instruction and use from meta tags in my webpage but i have problem yet.

when i upload my php files on other hosts i dont have any problem and they work is successfull, But when upload them on the my free host from HelioHost it replace all of persian charachters with ?(question mark)

 

also just php have this problem And when i get a unicode data from mySql database its not have problem

 

Example Source code

<?php

echo "متن فارسی";

?>

 

viewed page on other host

 

متن فارسی

view page on HelioHost

 

??? ????

 

i Think heliohost dosen't support Unicode Php ....

is this Correct?

Link to comment
Share on other sites

The problem was that you have a U+EFFF character at the top of your file. It's invisible to most editors, but it signifies UTF-16 encoding and the PHP parser might have caught it and turned off UTF-8. It's known as the byte order mark.

 

I copied your tes.html into test2.php and removed the byte order mark and it seems to work now.

Link to comment
Share on other sites

what text editor are you using ?

 

if it is notepad you need to

==>

GO TO NOTEPAD, IN SETTINGS->PREFERENCES->New Document/Default Directory-> (Select UTF-8 without BOM and select apply to opened ANSI files)

<==

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...