Forum Moderators: coopster & phranque

Message Too Old, No Replies

Decoding Japanese URLs into JAVA strings

Trying to decode Japanese URLs

         

philicious

12:42 am on Apr 2, 2003 (gmt 0)

10+ Year Member



How do you decode a URL that contains %uXXXX where the Xs are hexadecimal strings?

We are doing a multilingual web-based interface to some software, but we are having problems displaying characters decoded from a URL on a web page (an iframe).

Thanks,
Philicious (on behalf of the programmer who hates to ask for help).

tedster

4:22 am on Apr 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I assume you mean javascript strings - turning URLs into text strings that javascript can writeIn somewhere on a new page -- and that your question has nothing to do with the Java programming language (which is completely different from javascript).

Is that right? I ask because I think the word JAVA in the thread's title is scaring away comments for you.

philicious

4:39 am on Apr 2, 2003 (gmt 0)

10+ Year Member



thanks for the reply - we are talking about java rather than javascript.

We just want to know how to convert a character encoded in the form %uXXXX where the Xs are hexadecimal numbers as in Japanese characters encoded with the javascript function encode to java char's which i do believe are utf-16

Brett_Tabke

7:03 am on Apr 2, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Well, I do think you are into an area that isn't our 'forte around here. Unicode questions are few and far between - java questions even further.

Josk

2:27 pm on Apr 2, 2003 (gmt 0)

10+ Year Member



Have you taken a look at java.net.URLDecoder? In particular decode(String s, String enc)?

David_M

3:14 am on May 4, 2003 (gmt 0)

10+ Year Member



I use:
$text =~ s/\\x([0-9a-f][0-9a-f])/\%$1/gi;
$text =~ s/%([0-9a-f][0-9a-f])/pack("C",hex($1))/egi;
&jcode'convert(*text, 'sjis');
jcode is a seperate script.