Issue 169: export filename has Locale encoding problem!
Status:  Done
Owner: ----
Closed:  Apr 2009
Reported by qxodr...@gmail.com, Dec 21, 2008
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



Dec 21, 2008
#1 qxodr...@gmail.com
for solve this issue,I make a patch ,Now All Export View and ViewExporter have the
same parent(AbstractExportView,AbstractViewExporter)
fix-for-169.patch
33.4 KB   View   Download
Dec 22, 2008
Project Member #2 jeff.johnston.mn@gmail.com
Thank you! I will look at this patch right after the holidays...I won't be around
much the next couple weeks.
Feb 1, 2009
Project Member #3 jeff.johnston.mn@gmail.com
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...


Status: Started
Labels: -Type-Defect Type-Enhancement
Feb 1, 2009
Project Member #4 jeff.johnston.mn@gmail.com
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!
Apr 5, 2009
Project Member #5 jeff.johnston.mn@gmail.com
Added as part of the 2.4.2 release.
Status: Done