Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 432962

Summary: Cannot import a file with unicode characters in the filename
Product: [ECD] Orion Reporter: Anthony Hunter <ahunter.eclipse>
Component: ClientAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: john.arthorne, mamacdon
Version: 6.0   
Target Milestone: 6.0 M1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Example file
none
Example file none

Description Anthony Hunter CLA 2014-04-16 15:39:33 EDT
Created attachment 242072 [details]
Example file

Select "File->Import->File System" and choose a file with unicode, DBCS or emoji characters. The import gets stuck in the UI and I cannot continue or cancel with the X. I have to refresh the page and the import was not completed.
Comment 1 Anthony Hunter CLA 2014-04-16 15:40:25 EDT
Created attachment 242073 [details]
Example file

filename with emoji characters
Comment 2 Anthony Hunter CLA 2014-04-16 17:04:46 EDT
HTTP headers doesn't support UTF-8. So when the filename is being passed using the Slug header, the header needs to be URL-encoded.

I have added two Junit tests (for the attached files) and updated the TransferServlet
This is commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=ff01a12aa3b76c6a2c3dba2101ee24c1c5075012

We still need to fix the client.
Comment 3 Anthony Hunter CLA 2014-04-16 17:15:06 EDT
Client side has been fixed with commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=0e7e139f2e488af26ff02d87d3864eaa1d0ba0df
Comment 4 Mark Macdonald CLA 2014-04-16 18:34:48 EDT
This is kind of a nit, but Slug [1] is not decoded correctly by URLDecoder. The difference is how a '+' is treated: in an RFC-compliant Slug header it means a literal plus sign, but URLDecoder will convert it into a space. 

We have existing code in the client and server to deal with Slugs, so I moved that into helpers and called it from TransferServlet and the places in the client code as well.

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6c5a611
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=e31ebd6

[1] http://tools.ietf.org/html/rfc5023#section-9.7.1
Comment 5 Mark Macdonald CLA 2014-04-16 18:38:16 EDT
whoops, forgot the change to fileCommands.js, so one more commit here:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=cb241a1