A: 

try this:

  if (result.equals("&#x00E9")) {
     sb += char(130);
    }

instead of

  if (result.equals("&#x00E9")) {
     sb += "e";
    }

The thing is that you're not adding an accent to the top of the 'e' character, but rather that is a separate character all together. This site lists out the ascii codes for characters.

Stephen Wrighton
+2  A: 

Java Strings are unicode.

sb += '\u00E9';   # lower case  e + '
sb += '\u00C9';   # upper case  E + '
mobrule
This works for me, thanks for your help!
behrk2
+1  A: 

You can print out just about any character you like in Java as it uses the Unicode character set.

To find the character you want take a look at the charts here:

http://www.unicode.org/charts/

In the Latin Supplement document you'll see all the unicode numbers for the accented characters. You should see the hex number 00E9 listed for é for example. The numbers for all Latin accented characters are in this document so you should find this pretty useful.

To print use character in a String, just use the Unicode escape sequence of \u followed by the character code like so:

System.out.print("Let's go to the caf\u00E9");

Would produce: "Let's go to the café"

Depending in which version of Java you're using you might find StringBuilders (or StringBuffers if you're multi-threaded) more efficient than using the + operator to concatenate Strings too.

Steve Neal