Changeset d59eca


Ignore:
Timestamp:
Dec 8, 2007, 8:20:16 PM (14 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
910f21
Parents:
a8bf16
Message:

enable utf8 in headers

Location:
chrome/content/v_identity
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • chrome/content/v_identity/vI_addressBook.js

    ra8bf16 rd59eca  
    164164    getCardForAddress: function(email) {
    165165        // enumerate all of the address books on this system
     166        if (!email.match(/@/)) {
     167            vI_notificationBar.dump("## vI_addressBook: getCardForAddress got no email, aborting.\n")
     168            return null;
     169        }
    166170        var parentDir = vI_addressBook.rdfService.GetResource("moz-abdirectory://").QueryInterface(Components.interfaces.nsIAbDirectory);
    167171        var enumerator = parentDir.childNodes;
  • chrome/content/v_identity/vI_getHeader.js

    ra8bf16 rd59eca  
    129129                        value = hdr.getStringProperty(vI_getHeader.headerToSearch[index].headerNameToStore) +
    130130                        ", " + value;
    131                     hdr.setStringProperty(vI_getHeader.headerToSearch[index].headerNameToStore,value);
    132                     vI_notificationBar.dump(" ...stored");
    133                    
     131                    var unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
     132                        .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
     133                    unicodeConverter.charset = "UTF-8";                                 
     134                    hdr.setStringProperty(vI_getHeader.headerToSearch[index].headerNameToStore,unicodeConverter.ConvertFromUnicode(value) + unicodeConverter.Finish());
     135
     136                    storedValue = hdr.getProperty(vI_getHeader.headerToSearch[index].headerNameToStore,value)
     137                    storedConvValue = unicodeConverter.ConvertToUnicode(storedValue)
     138                    vI_notificationBar.dump(" ...stored as '" + storedConvValue + "'");
    134139                    if (!found) {
    135140                        label = vI_getHeader.strings.getString("vident.getHeader.headerFound");
  • chrome/content/v_identity/vI_smartIdentity.js

    ra8bf16 rd59eca  
    291291        // add emails from selected headers (stored by vI_getHeader.xul/js)
    292292        var reply_headers = vI.preferences.getCharPref("smart_reply_headers").split(/\n/)
     293        var unicodeConverter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
     294            .createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
     295        unicodeConverter.charset = "UTF-8";                                 
     296                   
    293297        for (index = 0; index < reply_headers.length; index++) {
    294298            // ------------- prepare fields to read the stored header ----------------
     
    308312
    309313            // ------------- read the stored header -------------------------------
    310             var value = hdr.getStringProperty("vI_" + replyHeaderNameToRead)
     314            var value = unicodeConverter.ConvertToUnicode(hdr.getStringProperty("vI_" + replyHeaderNameToRead))
    311315            vI_notificationBar.dump("## vI_smartIdentity: reading header '" +
    312316                replyHeaderNameToRead + "'\n");
Note: See TracChangeset for help on using the changeset viewer.