I want the string Game
to convert Game
. This string is a Japanese double byte string.
Is it possible to achieve this using PHP? If so, how?
First of all, Game
is not ASCII charset, so you might need to set the page Content-type
header to see a proper output:
header("Content-type: text/html; charset=utf-8");
Then you can convert it using this function
echo mb_convert_kana('Game', "R", 'UTF-8')
EDIT:
For MySQL I couldn't find a converter to do the same. However, you can still convert it manually on the Hex level, for example, you can get the word Game
like this
SELECT CHAR(0xefbca7, 0xefbd81, 0xefbd8d, 0xefbd85) as `Full Width`;
So, we can just write a mapping function in MySQL that replaces the characters using this table
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With