Jump to content

Default HTML encoding


houssam_ballout

Recommended Posts

hello all,I've an html pages that I put them on the ftp server, while trying to access them, the encoding changesbut in the HTML I'd put:<meta http-equiv="Content-Language" content="en-us"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">but is taking Cyrllic encoding?How can I fix it?I dont want the user to manually put the right encoding?Thanks in advance

Link to comment
Share on other sites

The webserver itself might be sending a different encoding in the header. I'm not sure which one takes priority, probably the server. Do you have a link that people can check? Can you run PHP on the server? If you can, you can send a header yourself which says the correct encoding.

Link to comment
Share on other sites

The webserver itself might be sending a different encoding in the header. I'm not sure which one takes priority, probably the server. Do you have a link that people can check? Can you run PHP on the server? If you can, you can send a header yourself which says the correct encoding.
How can I do that?any help would be acceptableThanks in advance
Link to comment
Share on other sites

How can I do that?any help would be acceptableThanks in advance
By adding
<?phpheader('Content-type: text/html;charset=utf-8');?>

At the very top of the document (and save it as a PHP document of course). Using this method is probably the best, unless you have access to the server configuration itself, but you probably don't, so it will be this one.Note that the file should actually be saved with UTF-8 encoding. That is, in Notepad for example, from the Save As menu, to select from the "Encoding" drop down menu "UTF-8".

Link to comment
Share on other sites

By adding
<?phpheader('Content-type: text/html;charset=utf-8');?>

At the very top of the document (and save it as a PHP document of course). Using this method is probably the best, unless you have access to the server configuration itself, but you probably don't, so it will be this one.Note that the file should actually be saved with UTF-8 encoding. That is, in Notepad for example, from the Save As menu, to select from the "Encoding" drop down menu "UTF-8".

I made this,Is there something that I can know what is the server defaults or know more about it?The characters are really disturbing me, nothing is working as for Characters
Link to comment
Share on other sites

I made this,Is there something that I can know what is the server defaults or know more about it?The characters are really disturbing me, nothing is working as for Characters
You mean that's not working? If so, then once again, do you have PHP? Link to the page? Did you saved the file with a .php extension encoded as UTF-8, having the above code sample put at the very beggining of the document (before the <html> element or the DTD if you've used such)?As for getting the server defaults, you can do so by searching the apache_response_headers() array, if PHP is installed as an Apache module (and you can check if it is by looking at phpinfo()). In other words- it's not exactly a walk in the park.P.S. I hate it when it comes down to encodings.
Link to comment
Share on other sites

How can I do that?
First, don't ignore the questions I asked. I asked 2 questions that would need an answer in order to provide help.
As for getting the server defaults, you can do so by searching the apache_response_headers() array, if PHP is installed as an Apache module (and you can check if it is by looking at phpinfo()). In other words- it's not exactly a walk in the park.
It's easy enough to get the values the server is using. Opera has an Info panel that I can open that will tell me the mime type and charset as sent by the server. I'm sure there's something for Firefox that will show that info as well. That's why I was saying, if we can get a link to the page in question we can probably answer this pretty quickly.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...