How to Pass Character set in WordPress

How to Pass Character set in WordPress

How to Pass Character set in WordPress-: A character set gives a list of the characters recognized by the hardware/software. So to instruct the browser to use a specific character set for rendering the page, you need to specify the character set of the webpage.

To give character encoding information directly affects the web page communication between server & client, form submissions, database connections etc. Your browser will have to guess in case you don’t pass a character set, and it may display “garbage” text. So, you can pass the default character set to prevent the display of errors.  Add a piece of code to your WordPress htaccess file.

How to Pass Character Set in WordPress using .htaccess file-:

How to Pass Character set in WordPress

.htaccess is a configuration file for use on web servers running the Apache Web Server software. When a .htaccess file is placed in a directory which is in turn ‘loaded via the Apache Web Server’, then the .htaccess file is detected and executed by the Apache Web Server software.

If your website hosted on Nginx server you will not have .htaccess file. In Nginx, you will use the try_files directive to accomplish the same thing.By default, the configuration file is named nginx.conf and placed in the directory /usr/local/nginx/conf , /etc/nginx or /usr/local/etc/nginx

These .htaccess files can be used to alter the configuration of the Apache Web Server software to enable/disable additional functionality and features that the Apache Web Server software has to offer. These facilities include basic redirect functionality, for instance, if a 404 file not found error occurs, or for more advanced functions such as content password protection or image hotlink prevention.

Add below code to your .htaccess file to Pass the Character Set in WordPress. Please note .htaccess file is very sensitive file take a backup before editing it. If you are unable to locate your .htaccess file read my post How to Locate .htaccess File in WordPress.

# pass the default character set
AddDefaultCharset utf-8

Thanks for reading…“Pardon my grammar, English is not my native tongue.”

If you like my work, Please Share on Social Media! You can Follow WP knol on Facebook, Twitter, Pinterest and YouTube for latest updates. You may Subscribe to WP Knol Newsletter to get latest updates via Email. You May also Continue Reading my Recent Posts Which Might Interest You.

About Amar Patel 263 Articles
Hi, I am Amar Patel from India. Founder, Author and Administrator of wpknol.com. I am a Simple Average Man who Loves life and Love living life.Professionally I am a Mechanical Engineer. Apart from my Job, I Love to write the things around WordPress WordPress CMS.