You are getting strange characters while writing posts in WordPress in hindi or indic languages like Marathi,Gujrati etc ?
I am going to show you a shortcut for WordPress installation to make it display Hindi or other Indic fonts correctly.
Method 1
Here are steps for this shortcut:
1.Go to root directory of your WordPress installation,there will be a file named wp-config.php
make a backup of it.
2. Now open it in any text editor. When you go through line 30-40 then you got following line
0
1
2
3
4
5
6
7
8
|
/** Database Charset to use in creating database tables. */
define(‘DB_CHARSET’, ‘utf8’);
/** The Database Collate type. Don’t change this if in doubt. */
define(‘DB_COLLATE’, ”);
|
3. Now put a “//” before
0
1
2
3
4
|
define(‘DB_CHARSET’, ‘utf8’);
define(‘DB_COLLATE’, ”);
|
then it will looks like
0
1
2
3
4
|
//define(‘DB_CHARSET’, ‘utf8’);
//define(‘DB_COLLATE’, ”);
|
Method 2
Some WordPress users reported that Method 1 is not working for them.
Well, Method 2 will work for them.
I have tested method 2 on Apache as well as IIS server.
Open wp-config.php file and make following changes
1. By default WordPress save data in UTF8 format.For Hindi contents to be visible.define Database Charset as follows.
0
1
2
|
define(‘DB_CHARSET’, ‘Unicode-UTF8’);
|
2. Change WordPress Localized Language to Hindi.
0
1
2
|
define(‘WPLANG’, ‘hi_IN’);
|
Make these changes and save wp-config.php file.Now Hindi and Indic contents should be visible for your WordPress based website.