wood burning stoves 2.0*
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 Java 8 in Action this week in the Java 8 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: 13883
    
  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: 36563
    
  16
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
How to hide key in client?
java. util. regex. PatternSyntaxException
resume parser
How to find the frequency of a particular word
Parsing encoded data?