Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2830

Class Media using incorrect charset

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 5.0.9, 7.0.3
    • None
    • Windows 7 64-bit, jdk1.7.0_80 64bit

      I am trying to upload a CSV file exported from MS Project (attached) to my web application, but the content returned does not respect the correct charset encoding of the file (Cp1252, pt-BR). Our application uses UTF-8 as default, by the way.
      The org.zkoss.util.media.Media class have three methods to return the content (getByteData does not work in this case): getStringData() , which returns an empty string, getStreamData(), which in this case throws an Exception, and then says to use getReaderData() instead. This last one works, but the charset encoding and the resulting file is not correct. I have tried to change the charset used in InputStream and OutputStream, while copying the file, but with no success.
      For all other file types we use, the return of Media is correct, but in this case is not.
      For example:
      Correct text: Projeto de Implantação da Gestão
      Error: Projeto de Implantaýýo da Gestýo

            Unassigned Unassigned
            Janio Janio
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: