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.
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.