Enabling UTF-8 Unicode language encoding in your page header.

UTF-8 allows for support of various languages, including Asian languages and their character depth. It is a widely supported and flexible character encoding, used for many European languages and can also represent Chinese, Japanese and Korean.

It's fairly simple to enable UTF-8 on your wiki pages. Currently PmWiki 2.0 versions have the UTF-8 file needed already loaded.

Here are the steps to enable UTF-8

  • Open your config.php file
  • Add this line:
    include_once($FarmD.'/scripts/xlpage-utf-8.php');
  • Save and upload your config.php file back to the server.
  • Convert existing page files containing international characters to UTF-8. You need to change the encoding string and the character encoding, and the encoding of the filenames, if they contain non-Latin characters.

'sed', 'recode', and 'convmv' can help to convert existing page files, e.g.

 sed -i s/^charset=ISO-8859-1/charset=UTF-8/
 recode ISO-8859-1..UTF-8
 convmv --help

If you validate your site you should see that UTF-8 is default encoding.

NOTE: The encoding type used when config.php is saved has an effect if you will be converting between character encodings on your wiki. Refer to page encoding for more details. If you are not using international characters then you do not need to be concerned about this.

See also Cookbook:UTF-8 for tips.



This page may have a more recent version on pmwiki.org: PmWiki:UTF-8, and a talk page: PmWiki:UTF-8-Talk.