Results 1 to 1 of 1
- 08-04-2011, 10:50 AM #1
Member
- Join Date
- Aug 2011
- Posts
- 4
- Rep Power
- 0
Need to write chinese characters to csv file
HI,
The issue is i am having data from database when i am writing it to csv file and when opened it in excel all values are coming in in a single column whereas rows are coming up , like i am having 4 column and two rows(one header and one value) , now i am getting one column and two rows.
I am using UTF-16LE encoding.
and also changing BOM to little Endian
i am appending values to StringBuffer and then appending values to that.
encoding is UTF-16LE
StringBuffer sb = new StringBuffer();
sb.append("Name");
sb.append(",");
b.append("Age");
sb.append(",");
b.append("DOB");
sb.append(","); etc..........
byte[] bytes = sb.toString().getBytes(encoding);
bytes[0] = (byte)255;
bytes[1] = (byte)254;
fileOut.write(bytes);
fileOut.flush();
fileOut.close();
the above code diaplays chinese but columns are not coming , its all in a single column
Need to display in different columns and also should be comma separated when opened with notepad
Similar Threads
-
Chinese characters in Excel
By Jayashreevmenon in forum Advanced JavaReplies: 4Last Post: 08-04-2011, 10:51 AM -
Certain Chinese Characters not displayed properly.
By kerwintang in forum Advanced JavaReplies: 1Last Post: 08-21-2009, 05:55 AM -
Write ctrl-z characters
By jithan in forum New To JavaReplies: 3Last Post: 02-18-2009, 03:11 AM -
Displaying Chinese characters on Swing components
By vaskarbasak in forum AWT / SwingReplies: 3Last Post: 06-26-2008, 08:27 AM -
drawString with Chinese Characters
By vaskarbasak in forum Advanced JavaReplies: 1Last Post: 06-10-2008, 07:49 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks