File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Handling special characters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Handling special characters" Watch "Handling special characters" New topic

Handling special characters

Subramanian Thiagarajan

Joined: Dec 07, 2004
Posts: 1

When i tried to encode the following character literal

" � " ,JVM takes it as unicode and internally converts to a different charset.
This char literal needs to be stored as it is.

Can anyone suggest how to handle this.
Joseph Maddison
Ranch Hand

Joined: Nov 04, 2004
Posts: 53
Please give more detail regarding your problem, if my following guess is not the problem you are seeing.

I have successfully used Strings to contain binary data in a convenient (and Hash-able) form. I would not be able to use it in this manner if it was performing random substitutions. Perhaps you are using a FileReader/FileWriter when you should be using a FileInputStream/FileOutputStream? That would change the character data to UTF-Something or other.

Convenience class for writing character files. The constructors of this class assume that the default character encoding and the default byte-buffer size are acceptable. To specify these values yourself, construct an OutputStreamWriter on a FileOutputStream.

Hope this helps,
I agree. Here's the link:
subject: Handling special characters