Meaningless Drivel is fun!*
The moose likes Other Open Source Projects and the fly likes How to export the chinese character to excel using ExcelCSVPrinter. Open the file within browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "How to export the chinese character to excel using ExcelCSVPrinter. Open the file within browser" Watch "How to export the chinese character to excel using ExcelCSVPrinter. Open the file within browser" New topic
Author

How to export the chinese character to excel using ExcelCSVPrinter. Open the file within browser

Thendral java
Greenhorn

Joined: Dec 30, 2009
Posts: 1
Hi,

Our application using in English, German, Franch and chinese.
String chineseCharacter=""; // chineseCharacter like 長长牀床東东彿佛. This chinese data coming from oracle database..
when i using,
responses.setContentType("text/html; charset=UTF-8");
It works fine for German , French and Chinese. (So There is no issue in Stream and Retrieval from database)

But when i using the following only i get junk values like 長长牀床東东彿佛. We using the windows Xp browser is IE , mozila and safari. Service pack 3

My code

--------------------------------------------------------------------------------


After export the data to excel show the result for 長长牀床東东彿佛. But not show the original result 長长牀床東东彿佛

I use the following stmt
responses.setContentType("text/html charset=UTF-8");
Its shows the correct result for chinese character.

I use the below statement
responses.setContentType("application/download; charset=UTF-8");
or
responses.setContentType("application/vnd.ms-excelset;charset=UTF-8");
or
responses.setContentType("application/vnd.ms-excel;charset=UTF-8");

The out put show the in the excel sheet 長长牀床東东彿佛 or some other jung characters.
What can i do here?. After export,I want to show the original chinese character in the excel sheet using the ExcelCSVPrinter.

Thanks & Regards
Thendral
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

CarefullyChooseOneForum while posting.
This is not a distributed java question. Moving to "Other opensource project"


apigee, a better way to API!
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Can you set the encoding on the ExcelCSVPrinter?


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to export the chinese character to excel using ExcelCSVPrinter. Open the file within browser