Jump to content

Recommended Posts

Posted

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
Posted

<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?

Posted

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.

Posted

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...