aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Getting Undesired Characters in My Strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Getting Undesired Characters in My Strings" Watch "Getting Undesired Characters in My Strings" New topic
Author

Getting Undesired Characters in My Strings

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
From a jQuery call I need to send some values to a remote database.

I am sending values like

3.51±.030
6.25±.030

but when checked at the servlet the values are like

3.51±.030
6.25±.030

I have tried escape(var ref) but then I get a value like

3.51%B1.030
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18113
    
    8

You have encoding problems. Read this article:

http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
Changing the charset=UTF-8 does not make any difference. I am changing the META tag on my jsp page.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Something like this?



I have run into a similar problem with production code, the data that was being returned as actually stored with the wrong content type. That was fun to figure out since it only failed on Ajax calls.

Eric
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1390
Thanks for the help.

The display from the database displayed ok. However when I updated the data is when the extra character would get appended. What I did was add the following to my servlet and is seems to have solved the problem:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Undesired Characters in My Strings
 
Similar Threads
Avoid space truncating , present in between words in a hyperlink
Trade Oracle 9i exam material
STS9i for ILT
Insert a Symbol into a TextArea String
Windows 2003 ODBC error code 126