This content has been marked as final.
Show 1 reply
-
1. Re: Problem with Euro and Yen currency characters
lviz Jul 5, 2005 11:16 AM (in response to suthakar)hi
1:
how do you export into an excel sheet?
2:
if you write a simple text file with the same application is the euro and yen character in the text file?
3:
simple code to read a file with euro and umlautspublic String readISO8859Message(String filename) { String fileStore = new String(); Charset charset = Charset.forName("ISO-8859-1"); //Charset charset = Charset.forName("ISO-8859-15"); CharsetDecoder decoder = charset.newDecoder(); CharsetEncoder encoder = charset.newEncoder(); try { FileChannel inCh = (new FileInputStream(filename)).getChannel(); int size = (int) inCh.size(); //log.debug("Filesize: " + size); ByteBuffer buf = ByteBuffer.allocate(size); CharBuffer cbuf = CharBuffer.allocate(size); inCh.read(buf); buf.rewind(); decoder.decode(buf, cbuf, false); cbuf.flip(); cbuf.rewind(); fileStore = cbuf.toString(); inCh.close(); } catch (Exception ex) { //log.error(ex.toString()); } return fileStore; }
cheers
L