This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Java in General and the fly likes How to do character decoding of accented characters in java 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 » Java » Java in General
Bookmark "How to do character decoding of accented characters in java" Watch "How to do character decoding of accented characters in java" New topic
Author

How to do character decoding of accented characters in java

Naga venkateswara Rao
Greenhorn

Joined: Dec 16, 2009
Posts: 7
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

Joined: Aug 16, 2005
Posts: 13868
    
  10

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;.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
To print < you write < and to print < you write <


That looks recursively ampersandic
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to do character decoding of accented characters in java
 
Similar Threads
java. util. regex. PatternSyntaxException
Parsing encoded data?
How to hide key in client?
resume parser
How to find the frequency of a particular word