Bug 809517

Summary: EPP-SP: File name is not displayed correctly if it contains Portuguese accent characters during uploading
Product: [JBoss] JBoss Enterprise Portal Platform 5 Reporter: Martin Weiler <mweiler>
Component: Site PublisherAssignee: Nobody <nobody>
Status: VERIFIED --- QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: 5.2.0.GACC: epp-bugs, pjha, theute, tkyjovsk
Target Milestone: ---   
Target Release: 5.2.1.CR02   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
After uploading a file with special characters in the name, the displayed file name showed incorrect characters. This has been fixed, and special characters in file names are now handled correctly during file upload.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Martin Weiler 2012-04-03 14:59:55 UTC
Description of problem:
When uploading files whose names containing Portuguese accent characters it shows incorrect chars


Steps to Reproduce:
1) configure JBoss run.conf by setting -Duser.country=BR -Duser.language=pt.
2) set browser language to pt_BR. set the ecmdemo language as pt_BR.
3) open site publisher EPP 5.2
4) when uploading files whose names containing accent characters it shows incorrect chars

Comment 1 Martin Weiler 2012-04-04 14:07:07 UTC
*** Bug 809851 has been marked as a duplicate of this bug. ***

Comment 2 Martin Weiler 2012-04-04 14:10:00 UTC
https://jira.exoplatform.org/browse/EXOGTN-735 needs to be ported to the EPP 5.2 code base:

--- component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java	(.../UploadHandler.java)	
+++ component/web/server/src/main/java/org/exoplatform/web/handler/UploadHandler.java	(.../UploadHandler.java)	
@@ -101,7 +101,8 @@
             }
             value.append("\n    \"").append(uploadIds[i]).append("\": {");
             value.append("\n      \"percent\":").append('\"').append((int)percent).append("\",");
-            value.append("\n      \"fileName\":").append('\"').append(encodeName(upResource.getFileName()))
+            String fileName = EntityEncoder.FULL.encode(upResource.getFileName());
+            value.append("\n      \"fileName\":").append('\"').append(encodeName(fileName))
                .append("\"");
             value.append("\n    }");
             if (i < uploadIds.length - 1)
			 
--- component/web/server/src/main/java/org/exoplatform/upload/UploadService.java	(.../UploadService.java)	
+++ component/web/server/src/main/java/org/exoplatform/upload/UploadService.java	(.../UploadService.java)	
@@ -124,7 +124,6 @@
       if (fileName == null)
          fileName = uploadId;
       fileName = fileName.substring(fileName.lastIndexOf('\\') + 1);
-      fileName = EntityEncoder.FULL.encode(fileName);
       String storeLocation = uploadLocation_ + "/" + uploadId + "." + fileName;

Comment 3 Martin Weiler 2012-04-11 09:46:58 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
After uploading a file with special characters in the name, the displayed file name showed incorrect characters. This has been fixed, and special characters in file names are now handled correctly during file upload.

Comment 4 Tomas Kyjovsky 2012-04-13 12:54:07 UTC
Verified with EPP-5.2.1.CR2 + jboss-eppsp-5.2.1.ER02-exo-2.3.6-CP01-120322114606.

The titles of uploaded files are ok, however there is another problem which seems even more serious: the uploaded file with title "ááááá ã ã ã óóóó.txt" cannot be saved when/after edited.

javax.jcr.PathNotFoundException: Node not found /sites content/live/%26aacute;%26aacute;%26aacute;%26aacute;%26aacute; %26atilde; %26atilde; %26atilde; %26oacute;%26oacute;%26oacute;%26oacute;.txt

This probably calls for a separate bug report.

Additionally, the view template for text files doesn't seem display these characters correctly as well. When a text file which contains "ááááá ã ã ã óóóó" is open in ContentExplorer it shows: "&aacute;&aacute;&aacute;&aacute;&aacute; &atilde; &atilde; &atilde; &oacute;&oacute;&oacute;&oacute;"

WYSIWYG editor in ContentExplorer shows the characters correctly.

Comment 5 JBoss JIRA Server 2012-04-17 09:13:00 UTC
Honza Fnukal <hfnukal> updated the status of jira GTNPORTAL-2419 to Resolved

Comment 6 prabhat jha 2012-04-17 13:27:15 UTC
Tomas, can you please create a new issue in BZ since this patch partly fixes the problem ?