This week's giveaway is in the Threads forum.
We're giving away four copies of Java Concurrency Live Lessons and have Doug Schmidt on-line!
See this thread for details.
Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Decode Search UTF-8 Keywords  RSS feed

 
Praveen Teegala
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

http://www.google.co.jp/search?q=%E3%83%95%E3%82%A1%E3%82%A4%E3%83%8A%E3%83%B3%E3%82%B9+%E9%9B%BB%E8%A9%B1%E5%B8%B3+&ie=UTF-8&hl=ja&btnG=Google+%E6%A4%9C%E7%B4%A2&lr=

The above is search url on google.co.jp for Japanese words (ファイナンス 電話帳 ).

The problem is,
How do I decode the Japanese keywords from the above URL.

Any help, is highly appreciated.

Thanks in Advance.
Praveen.
 
Roman Tomachinsky
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!

Just encountered the same problem.

I try to decode URL with Japanese search string and can't get "stable" result - for some Japanese characters it's fine but for others it's not OK.
For example, this Japanese string: 貴方のキャリアを最大限に活かし after decoding has the following look: 貴方�?�キャリアを最大�?�?�活�?��?�. As you can see, some characters are decoded fine.

I decode it using the following construct:


Application server - Weblogic 8, but I also tried on Weblogic 9.2 (JDK 1.5) - got the same result.

May be you know how to fix this?
Thanks a lot!
 
Roman Tomachinsky
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I've solved this problem myself. The problem was in URL encoding for the sake of SEO optimisation. So request.getQueryString() works not the same as request.getRequestURL().

Cheers
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!