Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to do character decoding of accented characters in java

 
Naga venkateswara Rao
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to convert the french characters to html entity codes i.e. from céréales to 'c&e acute;r&e acute;ales' (no space actually between e and a) using any method in java. I tried this method but doesnot know what is going wrong.



I'm calling this method with inputs as and only getting output as
Céréales or
Céréales


Can someone help me?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15484
43
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like your browser is using the wrong character encoding (maybe UTF-8) to display the text. Does the HTML page that is generated include a tag or header that specifies the character set? Make sure that it matches with the actual character encoding that is used for text on the page.

Note: This looks weird:

But that's not your fault; that's a problem in the forum software here, which has a problem with translating sequences such as & lt; and & gt;.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50225
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To print < you write < and to print < you write <


That looks recursively ampersandic
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic