Bug 160055 Copy Email Address should unescape e.g. %40 to @ r=dean_tessman sr=bz a=asa

git-svn-id: svn://10.0.0.236/trunk@205709 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
neil%parkwaycc.co.uk
2006-07-29 05:41:45 +00:00
parent 3191410474
commit 970cdd37f5

View File

@@ -640,6 +640,19 @@ nsContextMenu.prototype = {
addresses = url.substr( 7 );
}
// Let's try to unescape it using a character set
// in case the address is not ASCII.
try {
var characterSet = Components.lookupMethod(this.target.ownerDocument, "characterSet")
.call(this.target.ownerDocument);
const textToSubURI = Components.classes["@mozilla.org/intl/texttosuburi;1"]
.getService(Components.interfaces.nsITextToSubURI);
addresses = textToSubURI.unEscapeNonAsciiURI(characterSet, addresses);
}
catch(ex) {
// Do nothing.
}
var clipboard = this.getService( "@mozilla.org/widget/clipboardhelper;1",
Components.interfaces.nsIClipboardHelper );
clipboard.copyString(addresses);