Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2005

Tip: Looking for answers? Try searching our database.

Unicode characters in URL

Thread view: 
Vijay - 20 Jun 2005 20:55 GMT
hi all,

I have a servlet which takes in a name in the URL.
http://localhost/myServlet.123?name=blah

When this name contains unicode characters, then my ActionForm gets
different characters, not the ones posted. (On the status bar of IE6.0,
I can see that the URL contains the right value of the name). It seems,
while transmitting the get request, the name's value gets changed.

In the form's post request, everything works well.

Can anybody point out what is wrong here?

Thanks for any help...
Mickey Segal - 20 Jun 2005 21:07 GMT
> I have a servlet which takes in a name in the URL.
> http://localhost/myServlet.123?name=blah
[quoted text clipped - 3 lines]
> I can see that the URL contains the right value of the name). It seems,
> while transmitting the get request, the name's value gets changed.

Are you doing both URL and UTF encoding for output going to the servlet?
Are you using something like:
req.setCharacterEncoding("UTF-8");
in the receiving servlet?
Vijay - 21 Jun 2005 09:36 GMT
hi Segal,

java.net.URLDecoder.decode("%E6%AC%80%E6%AC%A8%E6%AD%81%E6%AB%BB%E6%AC%B8%E6%AD%A7.doc","UTF-8")
gives me the right value for the name.

However, it seems that when struts populates the name field in the
ActionForm, it  is not using the UTF-8 Encoding. I have also specified
UTF-8 encoding using request.setCharacterEncoding("UTF-8"). Is there a
workaround for this?

Thanks,
Mickey Segal - 21 Jun 2005 14:28 GMT
> hi Segal,
>
[quoted text clipped - 5 lines]
> UTF-8 encoding using request.setCharacterEncoding("UTF-8"). Is there a
> workaround for this?

Perhaps others will be more familiar with the details of your environment.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.