HostMonster Web Hosting Help

Character sets in PHP


How to Set different character sets with PHP and HTML to display correctly.


There is a character encoding setting inside of your php.ini file. By default, this is set to the standard Latin encoding (ISO-8859). If you would like to encode your page with different characters, like Arabic or Hindi, you will need to change this.

Most character sets will display correctly with UTF-8 encoding. If you're using an Asian character set, you may need to select a different encoding standard. To find out specific information about which character encoding will display your characters correctly Click Here.

You can find your php.ini file in this directory:
To change the character encoding in your php.ini file, find the following line and input your preferred character encoding. In the example below, UTF-8 is the character set.
    default_charset = "UTF-8"
Note: By default, the default_charset option is commented out. Be sure to delete the leading semi-colon so it does not look like this:

    ;default_charset = "UTF-8"
Knowledgebase Article 64,164 views bookmark tags: character language mysql php phpmyadmin sets (updated 2022 days ago)

Was this resource helpful?

Did this resolve your issue?

Please add any other comments or suggestions about this content:

Recommended Help Content

Instructions to set different character sets in HTML. Note: Not all character sets will be correctly rendered with this encoding format, but most will. You can find specific information about which ch (updated 1103 days ago)
Knowledgebase Article 72,357 views tags: arabic change character chinese html japanese language languages sets

What character sets are supported for MySQL? (updated 2039 days ago)
Knowledgebase Article 68,180 views tags: character mysql set sets

Emails are not sending out in the correct character sets. Recipients are receiving odd characters instead of the specified set. (updated 1218 days ago)
Knowledgebase Article 53,317 views tags: character email mail php set

Related Help Content

If suddenly when you go to your page, you get nothing on the page. You can still get HTML to display, just not PHP. To serve HTML pages to browsers, we don't associate the Apache processes with your 2 (updated 2071 days ago)
Knowledgebase Article 61,539 views tags: page php

How to Restore your MySQL Database? (updated 1047 days ago)
Knowledgebase Article 153,577 views tags: admin database mysql php phpmyadmin restore

A step by step guide on how to manipulate data in your mySQL tables using phpMyAdmin (updated 859 days ago)
Knowledgebase Article 41,154 views tags: databases mysql phpmyadmin

How do I import a backup of my database (.sql file) using phpMyAdmin? (updated 27 days ago)
Knowledgebase Article 138,720 views tags: database mysql phpmyadmin

Step by step directions on how you can search your database using phpMyAdmin (updated 859 days ago)
Knowledgebase Article 12,319 views tags: Plesk cpanel databases mysql phpmyadmin

A tutorial on how to perminately delete columns from your mySQL database using phpMyAdmin (updated 858 days ago)
Knowledgebase Article 36,327 views tags: Plesk cpanel databases mysql phpmyadmin

A guide to duplicating a MySQL database using phpMyAdmin (updated 860 days ago)
Knowledgebase Article 29,583 views tags: databases mysql phpmyadmin

Guidance on adding tables to your mySQL database in phpMyAdmin (updated 859 days ago)
Knowledgebase Article 14,849 views tags: mysql phpmyadmin