hello,
hello
i am tearing my hair with this one so i'd really really appreicate some help!
one of my programs needs to get the TITLE of an HTML page (using javascript for the document object) and pass it to my PHP page. this PHP page is in SHIFT_JIS encoding and the PHP page needs to search for
certain text and then store this title in the database.
however, when the PHP page receives the title, the text of the title is all junk already! (i dont know what is causing this..the javascript is just simply taking the document title and location.href =
"mypage.php?title=JSTITLE".
e.g., this page:
http://www.isize.com/study/2000/work/work_top.html
the title is (this is japanese text):
ŽdŽ–‚Ì‚½‚߂̎‘Ši"
(it will appear correctly if you change the encoding of your page to SHIFT_JIS etc)
so what i SHOULD see when my php page is accessed is this:
mypage.php?title=ŽdŽ–‚Ì‚½‚߂̎‘Ši"
but what i see the path in the URL as:
mypage.php?title=%u4ED5%u4E8B%u306E%u305F%u3081%u306E%u8CC7%u683C%u30FB%u30B9%u30AD%u30EB%u767A%u898B%u30B5%u30A4%u30C8
so, the japanese is getting jumbled! i think this has something to do with the way URLs are encoded and this is not 8-bit safe or something. (read it in the documentation of "rawurlencode" etc). however, i have tried decoding these percentage signs with:
base64_decode
rawurldecode
urldecode
and none of these three work! i tried "mb_convert_encoding($title)" but that doesn't do
anything.
does any one know what i can do to get the original japanese text from text that looks like these percentages?
help!
thanks so so much in advance!