zhoupan / jmesa

Automatically exported from code.google.com/p/jmesa
0 stars 0 forks source link

export filename has Locale encoding problem! #169

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in firefox using below code can solve this preblem.
fileName = new String(fileName.getBytes("UTF-8"), "ISO8859_1"); 

but in IE should use below code :
fileName = new String(fileName.getBytes(${LOCALE.ENCODING}), "ISO8859_1"); 
${LOCALE.ENCODING} = Locale Charset Encoding eg Chinese  ${LOCALE.ENCODING}
=GBK

Original issue reported on code.google.com by qxodr...@gmail.com on 22 Dec 2008 at 2:28

GoogleCodeExporter commented 9 years ago
for solve this issue,I make a patch ,Now All Export View and ViewExporter have 
the
same parent(AbstractExportView,AbstractViewExporter)

Original comment by qxodr...@gmail.com on 22 Dec 2008 at 3:43

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you! I will look at this patch right after the holidays...I won't be 
around
much the next couple weeks.

Original comment by jeff.johnston.mn@gmail.com on 22 Dec 2008 at 8:43

GoogleCodeExporter commented 9 years ago
I am wondering if the AbstractViewExporter.responseHeaders() method should not 
have
both the fileName btyes and the resulting String have the same encoding. 

I also think that in general the application should have a global encoding
preferences option instead of hard coding the UTF-8 everywhere. I also wonder 
if the
default encoding, if not specified should come from the request, and not the 
JVM with
the Charset.defaultCharset() method.

        String encoding = view.getCoreContext().getPreference(ENCODING);
        if (encoding == null) {
            encoding = Charset.defaultCharset().name();
        }
        String fn = new String(fileName.getBytes(encoding), encoding);

I should be checking in the changes to the trunk within the next hour...

Original comment by jeff.johnston.mn@gmail.com on 1 Feb 2009 at 7:11

GoogleCodeExporter commented 9 years ago
Ok, I have the patch applied on the trunk. I made a few tweaks, but not many.

I do have the encoding listed as just 'encoding' right now because I am 
thinking this
should be a global setting.

Let me know when you have time to test and how things work!

Original comment by jeff.johnston.mn@gmail.com on 1 Feb 2009 at 8:29

GoogleCodeExporter commented 9 years ago
Added as part of the 2.4.2 release.

Original comment by jeff.johnston.mn@gmail.com on 5 Apr 2009 at 1:04