aspose file tools
The moose likes Java in General and the fly likes Storage / Retrieval of mandarin from a flat 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 "Storage / Retrieval of mandarin from a flat file" Watch "Storage / Retrieval of mandarin from a flat file" New topic
Author

Storage / Retrieval of mandarin from a flat file

dwarakanathan thiru
Ranch Hand

Joined: Oct 14, 2009
Posts: 49
Hi All,

I have tried a number of attempts before coming here on the topic I have mentioned.

I work on JBoss portal. And my requirement is to have a module which allows you to paste MANDARIN charcters (Example: 喂 See, it does not come here !!) in a text box and then save it in a flat file on the server. I do not want to use the resource bundle for some reasons
Whatevere I paste (but displays properly in the JSP), gets saved as junk values in the text file. Any code that works good?

Also, If in case i store the ascii values say /u4444 format in the text file instead of trying to store the chinese symbol directly.
How to decode it to get the actual chinese symbol?

I have learnt about usage of utf8. But still no clue.

Please let me know on this.


Thanks,
Dwarak T
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

dwarakanathan thiru wrote:See, it does not come here !!

I can see it just fine.

I have learnt about usage of utf8. But still no clue.

But UTF-8 is not the Chinese charset. Check out charset.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12928
    
    3

I can also see the Chinese character in my browser just fine.

dwarakanathan thiru wrote:Whatevere I paste (but displays properly in the JSP), gets saved as junk values in the text file. Any code that works good?

Are you sure that the content of the text file is wrong, or is the software that you are using to view the text file not showing it correctly? Is the software that you use to display the file using a font that contains the Chinese characters?

Note that for example the Windows command prompt usually doesn't display non-ASCII characters very well, so if you do "type filename.txt" you'll most likely see question marks or garbage when the file contains non-ASCII characters.

Try using a good text editor (for example Notepad++) to view the text file.


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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Storage / Retrieval of mandarin from a flat file
 
Similar Threads
Special Characters '&' and ':'
Usage of inputTextarea in JSF
Go/Personalities
Melodies and intonations
Who uses C these days, and why?