aspose file tools
The moose likes Java in General and the fly likes Writing chineese characters to a txt file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Writing chineese characters to a txt file" Watch "Writing chineese characters to a txt file" New topic
Author

Writing chineese characters to a txt file

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 8795

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!


SCJP 1.4, SCWCD 1.4 - Hints for you, SCBCD Hints - Demnachst, SCDJWS - Auch Demnachst
Did a rm -R / to find out that I lost my entire Linux installation!
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12928
    
    3

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!)


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Writing chineese characters to a txt file
 
Similar Threads
How to lock a file?
Reading and Writing Chinese Characters from file
Character decoding in Java
Writing query results to an Excel sheet
Writing txt file to unix