1 Reply Latest reply on Jul 5, 2005 11:16 AM by lviz

    Problem with Euro and Yen currency characters

    suthakar

      Hi All,

      I'm trying to export the application data into excel sheet. When i do the export of the currency symbols, it is not getting exported and displaying a blank characters in excel. Any one of you, can help me to solve this issue?

      Here the details, what i've tried,

      I passed the java -Dfile.encoding parameter with this UTF-8/Cp1252 values, it started but it didn;t export. And when i tried to pass the value as "Unicode", jboss didn;t startup and it throws exception.

      I tried the same by setting in the java code also.

      Application running under Jboss 4.0.1 and Windows XP platform.

      -MS

        • 1. Re: Problem with Euro and Yen currency characters
          lviz

          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 umlauts

          public 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