• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Weird characters when reading a file

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do we know about the encoding of this file?

How was it created?

Bill
 
Tay Thotheolh
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic