Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with UTF-8 file creation  RSS feed

 
sumanjali reddyy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I m creating the CSV file by extracting data from db using UTF-8 encoding in java. The requirement is the file should be created in UTF-8 and EOL character should be forced to windows format(ie \r\n CRLF). I m running my program on unix machine. If there are some japanese characters then the file is created in UTF-8 and if it is only normal english its not created in UTF-8. Can someone help me on this.

Thanks in advance
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

if it is only normal english its not created in UTF-8.


Well, what is it created in? Note that a file that contains only ASCII characters below \U007F is a UTF-8 file (apart from the BOM, which the Java I/O routines don't generate anyway).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!