• Post Reply Bookmark Topic Watch Topic
  • New Topic

Writing chineese characters to a txt file  RSS feed

 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

Can anyone please help me in writing chineese characters which is in encoded form to a txt file? I have a String that has chineese characters in encoded form and I want to use some logic that will decode those chineese characters and write the chineese characters to a txt file. Please help me guys.

Thanks in advance!
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strings in Java consist of 16-bit Unicode characters.

You don't say anything about how your Chinese characters are encoded, so I cannot tell you how you should decode them.

To write the Chinese characters to a text file, you'll have to use a character encoding that supports Chinese characters. For example, UTF-8:

See also this: The Absolute Minimum Every Software Developer Absolutely, Positively Must Know About Unicode and Character Sets (No Excuses!)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!