Problem with unicode

Hello all. I am running a program that uses characters to send instructions to a machine we use here. The original version of this program was done in C but is now being ported to Java. One issue I am running into is the display of an extra character. I converted the character to an integer and it is 175. The C program displays this character as a horizontal bar valigned at the top (think upside down underscore). Java does display this character but adds an A with a carat on top of it (^) immediately before it.

I used BufferedReader to read in the file to see if I could just eliminate that character but when using charAt to display the characters in the line one by one, it prints the A with the horizontal bar. I need to display only the horizontal bar...how can I accomplish this?

[804 byte] By [lokisapocalypsea] at [2007-11-27 9:26:03]
# 1
Is this the only "top-bit set" character (i.e. with a code greater than 127) in the data?I expect you're reading an ASCII data stream using the platform default encoding, which is probably UTF-8.
dannyyatesa at 2007-7-12 22:22:57 > top of Java-index,Core,Core APIs...
# 2

Hi,

> I expect you're reading an ASCII data stream using the platform default encoding, which is probably UTF-8.

It is def. looks like charset confuse ;)

When You print the default one is used. Try out the link for detail:

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html#String(byte[],%20java.lang.String)

Good luck!

_Dima_a at 2007-7-12 22:22:57 > top of Java-index,Core,Core APIs...
# 3

The "upperscore" character has the code 175 in a number of character encodings, namely in Unicode, ISO-8859-1 and the infamous "Windows-1252".

I'd take the guess that your original character stream is encoded with ISO-8859-1, using fixed-width characters with one byte each.

Thus, you should try setting the "charset" parameter of your java.io.Reader to "ISO-8859-1".

McNeppa at 2007-7-12 22:22:57 > top of Java-index,Core,Core APIs...