Home linux UTF-8 encoding in HTML page

UTF-8 encoding in HTML page

Author

Date

Category

There is index.html , which, when started locally (Chrome, IE), is displayed correctly.

When downloading to a virtual server, and opening through Chrome – Abrakadabra.
Through IE – everything is OK (probably IE adjusts to the necessary encoding, although in the encoding the same – UTF-8 ).

in head there is a string:

& lt; meta charset = "UTF-8" & gt;

But wget returns: Charset = CP1251 . Why?

Perhaps you need to change something on the server? Linux server, UHTTPD


Answer 1, Authority 100%

Check out what encoding the index.html document itself: Open it for example in NotePad ++ Coding tab and select UTF8 Without BOM . After reboot to the server.


Answer 2, Authority 100%

The problem in the encoding given by the server in the headlines (Content-Type). It can be changed in the server configuration file (for apache httpd.conf), or in cases if it is not available on hosting or supports sites in different encodings, then you need to use the .htaccess file in the root folder of your site (where index.html, etc.)
If there is no .htaccess file, just create it. It needs to specify a string:

AdddefaultCharset UTF-8
Previous articleDynamic JAVA Array
Next articleAn arrays in Cudafy

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions