• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HowTo Correct Wrongly Encoded Characters

 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I'm using a java web library which makes use of a lot of third party components (Ajax, JScript, Struts etc.).

Problem is somewhere in the library there's an encoding problem which causes
umlaut likes '�' to be converted into something like this �� (Junk).

Is there a java library which can help me convert a faulty represented character?

I don't like to hunt through the java web library to find the error because I'm not very good a JScript and Ajax....

I would hate to do this with RegExp because I would surely miss one character. )

cheers,
Pete
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All Strings in Java are Unicode. So the character itself is not being changed, it is only being rendered incorrectly. Check you are using the correct character set where you output this character.

And you might benefit from reading this.
 
Pete Neu
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, I set the java locale to german and on the web page I use utf-8. So
I don't see what I can do else.

Any idea?

I don't know for sure if the problem is really in java but my question was can java correct the string which might be wrongly sent by JScript?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I don't know for sure if the problem is really in java but my question was can java correct the string which might be wrongly sent by JScript?



Is the web page that the JScript code runs in encoded in UTF-8 as well? Have you used a tool to examine which character is actually sent down the wire?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic