Reputation: 12664
I'm trying to output Chinese characters and Pinyin from my Game.php file.
In my Game.HTML file, just using <meta http-equiv="content-type" content="text/html; charset=utf-8" />
works fine.
But in my Game.PHP file, it does not. So I tried following these to get it to work:
1) How to best configure PHP to handle a UTF-8 website
At the top of my Game.PHP file, I've included this in the <head>
portion of the HTML... and I've added the specified default_charset
to my php.ini file, and the AddDefaultCharset
to my Apache file. What am I doing wrong?
Upvotes: 0
Views: 1521
Reputation: 1430
You should be able to use the PHP utf8_encode() function. Try $character = utf8_encode(put your character here) and be sure to use single or double quotes around the character.
In NotePAD++
Settings -> Preferences -> New Document/ Open Save Directory
Under New Document Encoding -> check UTF8 without BOM
Upvotes: 0