javascript unescape like php function

when you start dealing with languages (i.e. chinese) that require 8 bit encoding or more, you will learn about all the wonderful jazz of utf8, unicode, ISO etc. i was looking all over for a php function that does what javascript unescape does. normally rawurldecode would work, but…

not on utf8 strings. my problem is i saved my chinese into a browser cookie and then i wish php to read and translate it to unicode for the browser to display.
for example, i’d like php to translate the utf8 string:
%u6211%u662F%u8C46%u8C46
to:
我是豆豆
to display:
我是豆豆

it ran into problems and i couldn’t find a way for php to translate that. thank god for this nifty function :)


3 Comments Leave a Comment

Bubs [ Quote ]

Did you write that function yourself? *is amazed* :biggrin:

March 29th, 2005 at 12:47 pm
dodo [ Quote ]

no i didn’t.. i found it

March 29th, 2005 at 12:51 pm
aysen [ Quote ]

I was searching for something similar and found your blog… but the link you provided is dead - could you please resurrect it? :)

July 13th, 2007 at 8:50 am

Leave a Comment Name, email and comment are required.
Email will never be displayed.

Leave a Comment
  1. :biggrin: :blank: :blush: :bored: :confused: :cool: :down: :evil: :frown: :grin: :grr: :laidback: :left: :mad: :right: :sad: :secret: :shock: :smile: :stress: :tongue: :up: :wink: :yawn: :cute: :dead: :film: :floppy: :glasses: :grumpy: :headphones: :heart: :lightbulb: :ouch: :tv: :upsidedown: :vodka: :yell: :yuck: :yummy: