bbnn
bbnn

Reputation: 3602

convert this to japanese character (encoding)

Please help me convert this... I dont know how to call this kind of data, is it hex?

2%E6%9C%8819%E6%97%A5 

I believe that this should be printed as 2月19日

How can I convert 2%E6%9C%8819%E6%97%A5 to be 2月19日 using PHP?

Thank You

Upvotes: 0

Views: 1826

Answers (1)

Andrew M
Andrew M

Reputation: 9459

That looks like it's URL encoded http://en.wikipedia.org/wiki/Url_encoding

PHP UrlDecode might do the trick. http://www.php.net/manual/en/function.urldecode.php

There's an example at that link which shows url decoding the querystring of a page. I don't know PHP, but you might want soemthing like the following:

<?php
    $original = "2%E6%9C%8819%E6%97%A5";
    $decoded = urldecode($original);
    echo $decoded;
?>

Upvotes: 4

Related Questions