Skip to content

Commit

Permalink
Issue ticket poohsen#2
Browse files Browse the repository at this point in the history
Enable multibyte strings in title and body string
  • Loading branch information
Piroli YUKARINOMIYA committed May 11, 2014
1 parent e08ecdf commit 7eda968
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions chrome/thunderlink/content/thunderlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var ThunderLinkChromeNS = {
dump("CopyMessageUrlToClp mailboxMsgUrl: " + string + "\n");
var clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper);
clipboard.copyString(string);
clipboard.copyString( ThunderLinkChromeNS.ConvertToUnicode( string ));
}
catch (ex) {
dump("ex="+ex+"\n");
Expand Down Expand Up @@ -148,7 +148,7 @@ var ThunderLinkChromeNS = {

const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
var item = window.document.createElementNS(XUL_NS, "menuitem"); // create a new XUL menuitem
item.setAttribute("label", label );
item.setAttribute("label", ThunderLinkChromeNS.ConvertToUnicode( label ));
item.setAttribute("oncommand", "ThunderLinkChromeNS.CopyCustomTlStringToClp("+cstrnum+")");
return item;
}
Expand All @@ -168,6 +168,14 @@ var ThunderLinkChromeNS = {
}
},

ConvertToUnicode: function( string ) {
var converter = Components
.classes[ "@mozilla.org/intl/scriptableunicodeconverter" ]
.createInstance( Components.interfaces.nsIScriptableUnicodeConverter );
converter.charset = "UTF-8";
return converter.ConvertToUnicode( string );
},

dumpln: function(msg)
{
dump(msg + "\n");
Expand Down

1 comment on commit 7eda968

@mikehardy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are making a change in 1.2.7 that may affect this, in case you are still watching. Instead of using unicode, we are de-MIMEing the strings. It should work for multi-byte things still, but if something breaks and you notice it please let us know! New site is https://github.com/mikehardy/thunderlink/issues

Please sign in to comment.