This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Converting to Unicode ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Converting to Unicode ?" Watch "Converting to Unicode ?" New topic
Author

Converting to Unicode ?

Alexander Selling
Greenhorn

Joined: Apr 27, 2010
Posts: 16
I'm using the JExcel API to read an excel file but it doesn't seem to support international characters such as åäö(swedish).

And so my question is how can I convert the current encoding into something that supports swedish ? I read the JExcel API documentation and it says it's supposed to be Unicode by default, I've tried using unicode to utf8 and vice versa conversion methods but it doesn't make any difference.

For example "SÄB" is display as "SƒB".

Thanks in advance!





Alexander Selling
Greenhorn

Joined: Apr 27, 2010
Posts: 16
Okay so in case someone else decides to use JExcel(JXL), all you need to do is to convert from 8859_1 to default java like this:
String isoEncoding = new String(cell.getContens().getBytes(),"8859_1");
Tim Kaiser
Greenhorn

Joined: Sep 09, 2010
Posts: 2
Alexander Selling wrote:Okay so in case someone else decides to use JExcel(JXL), all you need to do is to convert from 8859_1 to default java like this:
String isoEncoding = new String(cell.getContens().getBytes(),"8859_1");


thanks for sharing the solution.
Reehan Lalkhanwar
Ranch Hand

Joined: Jun 16, 2007
Posts: 106
Thank you Alexander Selling, for both the question and the answer. Reduced a lot of searching for me. Really helpful.


Thank you,
Reehan
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Converting to Unicode ?
 
Similar Threads
JExcelApi - read a cell that contains a formula, but want to read the calculated value of the formul
drawing to the file with GDC
Cross referencing of excel sheets in jxl
JExcel API and Servlet - File upload
JExelApi read formulaNumberValue