Hi, guys
I'm interested in what you all think about adding a default charset to each language file, IN the language file, so contributors update it without problems, maybe as a label like like: $labels['default-charset'] = "windows-1251"; and then use it in roundcube to process message body and headers on messages not specifying content type.
The problem i'm trying to fix is that LOTS of crappy sites here in Bulgaria send messages in Bulgarian, but without specifying content-type encoding, or specify the content-type encoding, but do not encode the headers properly. I propose this process for selecting the encoding of the headers and message:
properly encoded - do nothing. 2. if the headers are not encoded with an encoding (i.e. they do not start with =?windows-1251? or whatever), and if an encoding was statet in the content-type header - use that to transform the headers. 3. if headers are not encoded, and the content-type states no encoding, use the one specified as default for the language currently used.
I need such a functionality for my setup (though i do not state the above steps are the most correct one in this case), and will develop it anyways. I'm just willing to get some feedback if you think this is the right way to do it, and will send a patch to the trac when it's ready.
Regards, Doichin
List info: http://lists.roundcube.net/dev/
NetOne - Doichin Dokov ??????:
Hi, guys
I'm interested in what you all think about adding a default charset to each language file, IN the language file, so contributors update it without problems, maybe as a label like like: $labels['default-charset'] = "windows-1251"; and then use it in roundcube to process message body and headers on messages not specifying content type.
The problem i'm trying to fix is that LOTS of crappy sites here in Bulgaria send messages in Bulgarian, but without specifying content-type encoding, or specify the content-type encoding, but do not encode the headers properly. I propose this process for selecting the encoding of the headers and message:
- if the message states content-type encoding, and the headers are
properly encoded - do nothing. 2. if the headers are not encoded with an encoding (i.e. they do not start with =?windows-1251? or whatever), and if an encoding was statet in the content-type header - use that to transform the headers. 3. if headers are not encoded, and the content-type states no encoding, use the one specified as default for the language currently used.
I need such a functionality for my setup (though i do not state the above steps are the most correct one in this case), and will develop it anyways. I'm just willing to get some feedback if you think this is the right way to do it, and will send a patch to the trac when it's ready.
Regards, Doichin
List info: http://lists.roundcube.net/dev/
I've talked about this in the trac a while ago -> http://trac.roundcube.net/ticket/1483839
Regards, Doichin _______________________________________________ List info: http://lists.roundcube.net/dev/
NetOne - Doichin Dokov wrote:
without problems, maybe as a label like like: $labels['default-charset'] = "windows-1251"; and then use it in roundcube to process message body and headers on messages not specifying content type.
Don't do this, instead just use UTF-8 throughout the site with all data that is handled within Roundcube. This makes your life much more easier if you stick to UTF-8!
Just my advice from my past experience with some large scale Websites and PHP applications....
Michael Baierl http://mbaierl.com/
2 + 2 = 5. For extreme large values of 2.
List info: http://lists.roundcube.net/dev/
Hi Doichin,
A fallback to ISO-Latin is already available in rcube_imap class. Search for ISO-8859-1. Maybe I missed some places that also need this fallback but in general it's there. However, the fallback charset should be a global setting and no language-specific thing.
~Thomas
On Dec 4, 2007 11:49 PM, NetOne - Doichin Dokov root@net1.cc wrote:
NetOne - Doichin Dokov ??????:
Hi, guys
I'm interested in what you all think about adding a default charset to each language file, IN the language file, so contributors update it without problems, maybe as a label like like: $labels['default-charset'] = "windows-1251"; and then use it in roundcube to process message body and headers on messages not specifying content type.
I've talked about this in the trac a while ago -> http://trac.roundcube.net/ticket/1483839
List info: http://lists.roundcube.net/dev/
Hi, Thomas
No, you've not missed a place which needs a charset falback. I've been using the patches i've made for this (http://trac.roundcube.net/ticket/1483839) since the first one was created (about 8 months ago), and have not had any encoding problems, but I'm just tired of patching each time I update roundcube.
If I implement a patch for this to be a global setting in the main.inc.php, will it eventually go into svn?
Regards, Doichin
Thomas Bruederli ??????:
Hi Doichin,
A fallback to ISO-Latin is already available in rcube_imap class. Search for ISO-8859-1. Maybe I missed some places that also need this fallback but in general it's there. However, the fallback charset should be a global setting and no language-specific thing.
~Thomas
On Dec 4, 2007 11:49 PM, NetOne - Doichin Dokov root@net1.cc wrote:
NetOne - Doichin Dokov ??????:
Hi, guys
I'm interested in what you all think about adding a default charset to each language file, IN the language file, so contributors update it without problems, maybe as a label like like: $labels['default-charset'] = "windows-1251"; and then use it in roundcube to process message body and headers on messages not specifying content type.
I've talked about this in the trac a while ago -> http://trac.roundcube.net/ticket/1483839
List info: http://lists.roundcube.net/dev/
Hi, Thomas
No, you've not missed a place which needs a charset falback. I've been using the patches i've made for this (http://trac.roundcube.net/ticket/1483839) since the first one was created (about 8 months ago), and have not had any encoding problems, but I'm just tired of patching each time I update roundcube.
If I implement a patch for this to be a global setting in the main.inc.php, will it eventually go into svn?
Regards, Doichin
Thomas Bruederli ??????:
Hi Doichin,
A fallback to ISO-Latin is already available in rcube_imap class. Search for ISO-8859-1. Maybe I missed some places that also need this fallback but in general it's there. However, the fallback charset should be a global setting and no language-specific thing.
~Thomas
On Dec 4, 2007 11:49 PM, NetOne - Doichin Dokov root@net1.cc wrote:
NetOne - Doichin Dokov ??????:
Hi, guys
I'm interested in what you all think about adding a default charset to each language file, IN the language file, so contributors update it without problems, maybe as a label like like: $labels['default-charset'] = "windows-1251"; and then use it in roundcube to process message body and headers on messages not specifying content type.
I've talked about this in the trac a while ago -> http://trac.roundcube.net/ticket/1483839
List info: http://lists.roundcube.net/dev/