• Post Reply Bookmark Topic Watch Topic
  • New Topic

URLEncoding UTF text

 
Yash Sharma
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am facing a strange problem, I hope I would be able to explain it well and request your time to try answer it:
I have a J2ME client that has a custom-made textbox to input text in Indic language (say Hindi). When a user enters his text a request goes to webserver and while sending this entry as HTTP request to a Servlet on server-side I encode the Unicode text output from this textbox using the following method:

As soon as the servlet fetches this word from the request (using request.getParameter("word")) the encoded word is decoded. Now the problem is I must pass this word again to another web-application that would translate this word into English. For this I must again append this unicode text to the TranslationServlet URL. So I encode this again, this time using URLEncode class (since I can now lay hands on it).
Here comes the catch. All this works absolutely fine when the app-server is running on Windows (client is on windows). But when I am testing it on webserver on a Linux 8.0 machine I face problem while encoding the text again to be sent to TranslationServlet. For eg: an encoded text which should look like '%E0%A4%B8%E0%A4%AE%E0%A5%80%E0%A4%B0' looks like '%C3%A0%C2%A4%C2%B8%C3%A0%C2%A4%C2%AE%C3%A0%C2%A5%C2%80%C3%A0%C2%A4%C2%B0' after I re-encode it (on linux machine). The appserver on windows in WAS-4 while that on Linux is WAS-5.
What could be the problem? Is this due to WAS or the OS?
[ March 02, 2004: Message edited by: Yash Sharma ]
 
Sonu Kaush
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can check the encoding for JVM in the WAS server.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!