Changeset 910f21


Ignore:
Timestamp:
Dec 9, 2007, 10:13:24 AM (14 years ago)
Author:
rene <rene@…>
Branches:
master
Children:
12d9a5d
Parents:
d59eca
Message:

overall utf8 compatibility

Location:
chrome/content/v_identity
Files:
6 edited

Legend:

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

    rd59eca r910f21  
    179179                    = vI.preferences.getBoolPref("doFcc");
    180180                vI_account.account.defaultIdentity.fccFolder
    181                     = vI.preferences.getCharPref("fccFolder");
     181                    = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("fccFolder"));
    182182                vI_account.account.defaultIdentity.fccFolderPickerMode
    183183                    = vI.preferences.getCharPref("fccFolderPickerMode");
     
    211211            dump ("## vI_account: preparing Draft --- use Virtual Identity Settings\n");
    212212            vI_account.account.defaultIdentity.draftFolder
    213                 = vI.preferences.getCharPref("draftFolder");
     213                = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("draftFolder"));
    214214            vI_account.account.defaultIdentity.draftsFolderPickerMode
    215215                = vI.preferences.getCharPref("draftFolderPickerMode");
     
    238238            dump ("## vI_account: preparing Templates --- use Virtual Identity Settings\n");
    239239            vI_account.account.defaultIdentity.stationeryFolder
    240                 = vI.preferences.getCharPref("stationeryFolder");
     240                = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("stationeryFolder"));
    241241            vI_account.account.defaultIdentity.tmplFolderPickerMode
    242242                = vI.preferences.getCharPref("stationeryFolderPickerMode");
  • chrome/content/v_identity/vI_addressBook.js

    rd59eca r910f21  
    138138            addrbook.QueryInterface(Components.interfaces.nsIAbDirectory);
    139139            for each (var prop in vI_addressBook.CardFields) {
    140                 var searchUri = addrbook.directoryProperties.URI + "?(or(" + prop + ",c,vIdentity:))"; // search for the address in this book
     140                var searchUri = (addrbook.directoryProperties?addrbook.directoryProperties.URI:addrbook.URI) + "?(or(" + prop + ",c,vIdentity:))"; // search for the address in this book
    141141                var directory = vI_addressBook.rdfService.GetResource(searchUri).QueryInterface(Components.interfaces.nsIAbDirectory);
    142142                // directory will now be a subset of the addressbook containing only those cards that match the searchstring 'address'
     
    186186            var addrbook = enumerator.getNext();  // an addressbook directory
    187187            addrbook.QueryInterface(Components.interfaces.nsIAbDirectory);
    188             var searchUri = addrbook.directoryProperties.URI + "?(or(PrimaryEmail,c," + recipient_email + ")(SecondEmail,c," + recipient_email + "))";  // search for the address in this book
     188            var searchUri = (addrbook.directoryProperties?addrbook.directoryProperties.URI:addrbook.URI) + "?(or(PrimaryEmail,c," + encodeURIComponent(recipient_email) + ")(SecondEmail,c," + encodeURIComponent(recipient_email) + "))";  // search for the address in this book
    189189            //~ vI_notificationBar.dump("## vI_addressBook: searchUri '" + searchUri + "'\n");
    190190            var directory = vI_addressBook.rdfService.GetResource(searchUri).QueryInterface(Components.interfaces.nsIAbDirectory);
  • chrome/content/v_identity/vI_getHeader.js

    rd59eca r910f21  
    3939            .getBranch("extensions.virtualIdentity."),
    4040           
     41    unicodeConverter : Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
     42            .createInstance(Components.interfaces.nsIScriptableUnicodeConverter),
     43
    4144    strings : document.getElementById("vIdentBundle"),
    4245   
     
    4447   
    4548    prepareHeaderToSearchArray : function() {
    46         var headerList = vI_getHeader.preferences.getCharPref("smart_reply_headers").split(/\n/)
     49        var headerList = vI_getHeader.unicodeConverter.ConvertToUnicode(vI_getHeader.preferences.getCharPref("smart_reply_headers")).split(/\n/)
    4750       
    4851        vI_getHeader.headerToSearch = [];
     
    6770    },
    6871
    69     adaptPreferences : function() {
    70         // this is only for transition from 0.4.0 to 0.4.1, will be removed after a while
    71         try {   if (vI_getHeader.preferences.getBoolPref("smart_reply_prefer_headers")) {
    72                 vI_notificationBar.dump("## vI_getHeader: preference-format changed\n## vI_getHeader: appending 'to' and 'cc' to header-list\n")
    73                 vI_getHeader.preferences.setCharPref("smart_reply_headers",
    74                     vI_getHeader.preferences.getCharPref("smart_reply_headers") + "\nto\ncc")
    75             }
    76             else {
    77                 vI_notificationBar.dump("## vI_getHeader: preference-format changed\n## vI_getHeader: inserting 'to' and 'cc' to header-list\n")
    78                 vI_getHeader.preferences.setCharPref("smart_reply_headers",
    79                     "to\ncc\n" + vI_getHeader.preferences.getCharPref("smart_reply_headers"))
    80             }
    81             vI_getHeader.preferences.clearUserPref("smart_reply_prefer_headers")
    82             vI_notificationBar.dump("## vI_getHeader: 'smart_reply_prefer_headers' preference-entry removed\n")
    83         }
    84         catch(vErr) { }
    85     },
    86 
    8772    getHeader: function() {
    8873        vI_notificationBar.clear_dump()
     
    9075        var index;
    9176
    92         vI_getHeader.adaptPreferences();
    93        
    9477        var srcMsgURI = GetLoadedMessage();
    9578        if (srcMsgURI == null) return;
     
    129112                        value = hdr.getStringProperty(vI_getHeader.headerToSearch[index].headerNameToStore) +
    130113                        ", " + value;
    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());
     114                    hdr.setStringProperty(vI_getHeader.headerToSearch[index].headerNameToStore,vI_getHeader.unicodeConverter.ConvertFromUnicode(value) + vI_getHeader.unicodeConverter.Finish());
    135115
    136116                    storedValue = hdr.getProperty(vI_getHeader.headerToSearch[index].headerNameToStore,value)
    137                     storedConvValue = unicodeConverter.ConvertToUnicode(storedValue)
     117                    storedConvValue = vI_getHeader.unicodeConverter.ConvertToUnicode(storedValue)
    138118                    vI_notificationBar.dump(" ...stored as '" + storedConvValue + "'");
    139119                    if (!found) {
     
    193173        vI_notificationBar.dump("## vI_prepareHeader: init\n");
    194174        if (vI_prepareHeader.addExtraHeader()) vI_prepareHeader.addObserver();
     175        vI_getHeader.unicodeConverter.charset = "UTF-8";
    195176    },
    196177   
     
    219200    addExtraHeader : function() {
    220201        vI_notificationBar.dump("## vI_prepareHeader: addExtraHeader\n");
    221         var header_list = vI_prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_headers").split(/\n/)
     202        var header_list = vI_getHeader.unicodeConverter.ConvertToUnicode(vI_prepareHeader.prefroot.getCharPref("extensions.virtualIdentity.smart_reply_headers")).split(/\n/)
    222203        try {
    223204            var extraHdrs = " " +
  • chrome/content/v_identity/vI_prefDialog.js

    rd59eca r910f21  
    3232                .getService(Components.interfaces.nsIPrefService)
    3333                .getBranch("extensions.virtualIdentity."),
     34               
     35    unicodeConverter : Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
     36                .createInstance(Components.interfaces.nsIScriptableUnicodeConverter),
    3437   
    3538    base : {
     
    97100                        vI_prefDialog.preferences.getIntPref(element.getAttribute("prefstring")) );
    98101                    else element.setAttribute("value",
    99                         vI_prefDialog.preferences.getCharPref(element.getAttribute("prefstring")) );
     102                        vI_prefDialog.unicodeConverter.ConvertToUnicode(vI_prefDialog.preferences.getCharPref(element.getAttribute("prefstring"))) );
    100103                } catch (ex) {}
    101104            }
     
    119122                            element.getAttribute("prefstring"), element.value);
    120123                    else vI_prefDialog.preferences.setCharPref(
    121                             element.getAttribute("prefstring"), element.value);
     124                            element.getAttribute("prefstring"), vI_prefDialog.unicodeConverter.ConvertFromUnicode(element.value));
    122125                    //~ alert(elementID + " " + element.getAttribute("prefstring") + " " + parseInt(element.value))
    123126                }
     
    244247
    245248    init : function() {
     249        vI_prefDialog.unicodeConverter.charset="UTF-8";
    246250        vI_prefDialog.base.init();
    247251        onInitCopiesAndFolders()
  • chrome/content/v_identity/vI_smartIdentity.js

    rd59eca r910f21  
    193193                    id_keys : { }, smtp_keys : { } };
    194194       
    195         var filter_list = vI.preferences.getCharPref("smart_reply_filter").split(/\n/)
     195        var filter_list = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("smart_reply_filter")).split(/\n/)
    196196        if (filter_list.length == 0) filter_list[0] == ""
    197197       
     
    290290    collectAddresses : function(all_addresses, hdr) {
    291291        // add emails from selected headers (stored by vI_getHeader.xul/js)
    292         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";                                 
     292        var reply_headers = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("smart_reply_headers")).split(/\n/)
    296293                   
    297294        for (index = 0; index < reply_headers.length; index++) {
     
    312309
    313310            // ------------- read the stored header -------------------------------
    314             var value = unicodeConverter.ConvertToUnicode(hdr.getStringProperty("vI_" + replyHeaderNameToRead))
     311            var value = vI.unicodeConverter.ConvertToUnicode(hdr.getStringProperty("vI_" + replyHeaderNameToRead))
    315312            vI_notificationBar.dump("## vI_smartIdentity: reading header '" +
    316313                replyHeaderNameToRead + "'\n");
     
    381378                vI_notificationBar.dump("## vI_smartIdentity: filtering done, " + all_addresses.number + " address(es) left\n")
    382379               
    383                 var smart_reply_defaultFullName = vI.preferences.getCharPref("smart_reply_defaultFullName")
     380                var smart_reply_defaultFullName = vI.unicodeConverter.ConvertToUnicode(vI.preferences.getCharPref("smart_reply_defaultFullName"))
    384381                if (smart_reply_defaultFullName != "") {
    385382                    for (index = 0; index < all_addresses.number; index++) {
  • chrome/content/v_identity/v_identity.js

    rd59eca r910f21  
    9292                .getService(Components.interfaces.nsIMsgHeaderParser),
    9393   
     94    unicodeConverter : Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
     95                .createInstance(Components.interfaces.nsIScriptableUnicodeConverter),
     96
    9497    // Those variables keep pointers to original functions which might get replaced later
    9598    original_functions : {
     
    210213        // clear the DebugArea (not needed cause window is new)
    211214        //~ vI_notificationBar.clear_dump()
    212    
     215        vI.unicodeConverter.charset="UTF-8";
     216       
    213217        // initialize the pointers to extension elements
    214218        vI.elements.init_base()
Note: See TracChangeset for help on using the changeset viewer.