Fwd: Re: [imp] Feature request for CVS (HEAD) Imp: correct charset
Jan Schneider
jan at horde.org
Thu Feb 13 16:19:29 PST 2003
----- Weitergeleitete Nachricht von vviitane+mail.imp at mappi.helsinki.fi -----
Datum: Thu, 13 Feb 2003 17:12:14 +0200
Von: Viljo Viitanen <vviitane+mail.imp at mappi.helsinki.fi>
Antwort an: Viljo Viitanen <vviitane+mail.imp at mappi.helsinki.fi>
Betreff: Re: [imp] Feature request for CVS (HEAD) Imp: correct charset
An: Jan Schneider <jan at horde.org>
Quoting Jan Schneider <jan at horde.org>:
> And please provide patches, ideas or solutions instead of just asking
> "Could
> you please...". This is open source, if something is broken for you or
> doesn't work as you expected, fix it.
I would have thought that my request was also an idea: no 8 bit chars -> use
US-ASCII. More proper behaviour, searching the most suitable charset when
there are 8bit characters present, is pretty difficult. I'm not terribly
fond of letting the (stupid) user choose the charset himself (most people
don't know what a charset is!), this should "just work".
Anyway, I don't have cvs imp installed, so I'm not sure this works at all.
Perhaps you (or anyone who's interested) could test this? I've hacked an
equivalent thing in my local imp 3.1 installation, along with an
utf8-locale, and it works fine. Oh, and I suppose that every charset
different imp languages use, are US-ASCII supersets, ie. when there only are
7bit-characters, the charset can be safely set as US-ASCII. I'm not 100%
sure if this is the case. (I would appreciate if someone could verify this.)
Patch to horde/lib/MIME/Part.php, revision 1.129:
% diff Part.php_orig Part.php
1069,1071c1069,1071
< /* Should we convert to 7-bit encoding? */
< if (($this->getTransferEncoding() == '7bit') &&
< MIME::is8bit($text)) {
---
> /* Should we convert to 7-bit encoding? */
> 8bit=MIME::is8bit($text);
> if (($this->getTransferEncoding() == '7bit') && 8bit) {
1080c1080,1085
< $this->setCharset($this->getCharset(true));
---
> if (($this->getTransferEncoding() == '7bit') && ! 8bit) {
> $this->setCharset('US-ASCII');
> }
> else {
> $this->setCharset($this->getCharset(true));
> }
--
Viljo Viitanen
(please use address Viljo.Viitanen at helsinki.fi for personal replies)
----- Ende der weitergeleiteten Nachricht -----
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - discover your knowledge
http://www.tip4all.de - Deine private Tippgemeinschaft
More information about the imp
mailing list