Skip to content

Commit

Permalink
cut/copy: make utf8 copying work
Browse files Browse the repository at this point in the history
  • Loading branch information
mimecuvalo committed Nov 14, 2014
1 parent e0c971c commit 4a36918
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/nsIFireFTPUtils.js
Expand Up @@ -166,6 +166,8 @@ FireFTPUtils.prototype = {
newFile.remove(true);
}

newName = decodeURI(newName); // XXX Firefox doesn't send UTF8 across component boundary correctly.

if (isCut) {
file.moveTo(newDir, newName); // cut
} else {
Expand Down
4 changes: 3 additions & 1 deletion src/content/js/local/localTree.js
Expand Up @@ -1174,7 +1174,9 @@ var localTree = {
}
}

var innerEx = gFireFTPUtils.cutCopy(this.isCut, zeFiles[x], newFile, newDir, newFile.leafName);
// XXX Firefox doesn't send UTF8 across component boundary correctly.
// So we encodeURI on the leafName to fix that. Woo.
var innerEx = gFireFTPUtils.cutCopy(this.isCut, zeFiles[x], newFile, newDir, encodeURI(newFile.leafName));

if (innerEx) {
throw innerEx;
Expand Down

0 comments on commit 4a36918

Please sign in to comment.