File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes URL, UTF-8 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "URL, UTF-8" Watch "URL, UTF-8" New topic
Author

URL, UTF-8

Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
Hi Ranchers,
I'm in a bit of a pickle and am hoping someone will set me in the right direction. The problem I'm trying to solve is in the context of a web application. The user types a character string in the browser, then we use AJAX to pass the user's string to the server, which persists the string to the DB. All pretty normal stuff. The problem arises when the user's string contains international symbols.

if the user types in "bénévoles" we call encodeURIComponent(..) to get "b%C3%A9n%C3%A9voles" ... the value that is stuffed into the AJAX request to the server. The problem is that sometimes the value received by the server is not "bénévoles" but "bénévoles" .... strange stuff! I say that the server sometimes gets that "bénévoles" value because I've only been able to reproduce the behavior on a deployed instance of our product, not on my local development machine. The most obvious delta I see between my development box (no problem) and our deployed product (user text garbled) is the the former isn't using SSL, but the latter does.

I'm thinking I'll try to introduce SSL to my development box in an effort to reproduce the problem ... but I'm wondering if I'm wasting my time. Has any one ever seen AJAX+SSL cause encoding problems (like the one I describe above)?

Any advice or suggestions are greatly welcomed.


Fun programming etcetera!
Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
I did eventually figure this out. And the problem had nothing to do with SSL. For anyone else who needs to solve a similar problem, the root cause for me was an uber-old application server that didn't properly decode UTF-8.
 
wood burning stoves
 
subject: URL, UTF-8
 
Similar Threads
AJAX Chat Problem
Attn:kyle-A resource was unable to process the two phase commit (Urgent)
Websphere Portal Server - User's seeing each other's data!
On security and intellectual property
Multiple user Ajax problem