aspose file tools*
The moose likes Java in General and the fly likes Weird characters when reading a file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Weird characters when reading a file" Watch "Weird characters when reading a file" New topic
Author

Weird characters when reading a file

Tay Thotheolh
Ranch Hand

Joined: Aug 07, 2008
Posts: 84
Hi. I tried to read a file containing english and japanese characters. It gave me the following output when I System.out.println them out ...

\'87\'47\u12840?\f1\'a1\'44 - 9 - \'ca\'c0\'bd\'e7\'d6\'d0\'a4\'ac\'a5\'cf\'a5\'c3\'a5\'d4\'a9\'60\'a5\'d0\'a9\'60\'a5\'b9\'a5\'c7\par


Are these ascii , unicode , hex or what kind of character set are they ?

Some of the text in the data file I read in are ...

偼側儅儖僢両 - - 偒偭偲丄偢偭偲


These are some asian scripts and characters... most likely traditional chinese scripts.

How do I handle these weird println characters and convert them back to it's more readable asian looking scripts?

William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12781
    
    5
What do we know about the encoding of this file?

How was it created?

Bill
Tay Thotheolh
Ranch Hand

Joined: Aug 07, 2008
Posts: 84
I was trying to build a list of files I have in a folder into a data file (rtf format) by copying and pasting all the filenames into a rtf file.
 
jQuery in Action, 2nd edition
 
subject: Weird characters when reading a file