A number of our customers are experiencing this issue. The problem occurs because 000webhost’s servers are already specifying the character set within the transfer protocol, that being UTF-8. This causes the browser to overwrite the chosen charset inside the document with that provided by the server.
UTF-8 however does not cover all characters with all accents, therefore we’ve created this tutorial which will help you overwrite server’s configuration.
For plain HTML documents
Go to 000webhost cPanel (choose the website you’re working with) > Tools (from left menu) > File Manager > Upload files now
Go to /public_html folder
Double click on .htaccess file (if you have no such file, go to the top right corner of the screen, and select “New File”. Name it .htaccess)
Add this code to a new line: AddDefaultCharset Off
Save the file.
Now you can specify the character set inside the document by appending
<meta charset="CHARACTER_SET"> tag within <head> [...] </head>
No, this form does not modify your original documents.
No, this form does not convert characters from another area into UTF-8! This is simply a trick to force 000webhost’s servers to specify the chosen charset to the browser.
To add either <meta charset> tag to your HTML document, or header() function to your PHP script, first download it using a FTP client, and then modify it manually using a text editor (preferable Notepad++). Then upload your document to your server again.
If you have any questions or any bugs to report, please do post them here.
thank you for your reply
I understand pretty well what you say, consider that my site has been developed with codeigniter, I create a folder named convert in mywebsite / forget it is in the folder public_html?
Then if I move the files on which I want to apply the conversion to the convert folder, will the referencing in my controller code for example ($this->load->view(‘my_page’) ) always work? Or after conversion, do I have to re-file the files in the view folder so that it works?
This gives the option to convert all link extensions from .htm to .php
This is good for internal links, but, it would also convert all links to external sites, the external links would then be ‘dead’.
It would be more useful to have 000webhost’s servers not specifying the character set within the transfer protocol.
bsananda asked me “how do you do this?” concerning my statement “For me, AddDefaultCharset off works fine”. A description of what I did follows.
There was a file .htaccess in the root directory of my site, and it consisted of the four lines between the horizontal rules below (an empty first one taken into account):
HTID:1162044: DO NOT REMOVE OR MODIFY THIS LINE AND THE LINES BELOW
php_value display_errors 1
# DO NOT REMOVE OR MODIFY THIS LINE AND THE LINES ABOVE HTID:1162044:
I modified the file in question by adding the following line after the last one: AddDefaultCharset off