• Post Reply Bookmark Topic Watch Topic
  • New Topic

HowTo Correct Wrongly Encoded Characters  RSS feed

 
Pete Neu
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • 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
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • 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
  • 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?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • 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?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!