• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Getting Undesired Characters in My Strings

 
Ranch Hand
Posts: 2232
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 28293
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have encoding problems. Read this article:

http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/
 
Steve Dyke
Ranch Hand
Posts: 2232
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Changing the charset=UTF-8 does not make any difference. I am changing the META tag on my jsp page.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 2232
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

 
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic