mhonarc-users

Followup regarding "Unrecognized character set: windows-1252" messages

2000-12-26 18:30:56
Just a followup regarding the (harmless) warning messages about unrecognised character sets, most often windows-1252 (for the benefit of those looking through the archives - see the bottom if you just want the what-to-do summary):

As noted previously on this list, even after adding (say) windows-1252 to your <CharsetConverters>, one still continues to see warning messages. These are from mhtxtplain.pl, which doesn't use <CharsetConverters> fully (although it prolly should (Earl said he couldn't remember why it doesn't - http://www.xray.mpe.mpg.de/mailing-lists/mhonarc/2000-11/msg00045.html)).

In response to Earl's message, Robert Hsiung asked (http://www.xray.mpe.mpg.de/mailing-lists/mhonarc/2000-11/msg00048.html) if he should modify the lines:
     ## Check MIMECharSetConverters if charset should be left alone
     if (defined($readmail::MIMECharSetConverters{$charset}) and
            $readmail::MIMECharSetConverters{$charset} eq "-decode-") {
        $asis{$charset} = 1;
     }
in mhtxtplain.pl to:
     ## Check MIMECharSetConverters if charset should be left alone
     if (defined($readmail::MIMECharSetConverters{$charset})) {
        $asis{$charset} = 1;
     }
While this would work fine, it does of course require that you redo any modifications to the code when you upgrade, etc, and there is a cleaner way to do it:

Instead you can accomplish exactly the same thing by supplying the 'asis' parameter using <MIMEArgs>, without needing any modifications to the perl script. For example, I changed mine from

<MIMEArgs>
text/*: maxwidth=80
text/plain: maxwidth=80
</MIMEArgs>

to:

<MIMEArgs>
text/*: maxwidth=80
text/plain: maxwidth=80 asis=windows-1252:iso-8859-15
</MIMEArgs>

We're changing text/plain because that's the important one where (for me at least) mhtxtplain.pl was being used. I'm not sure if the asis parameter should be supplied for any of the other types that use mhtxtplain.pl, I haven't seemed to need to so far.

(as you can see I'm suppressing warnings about windows-1252 and iso-8859-15; the maxwidth stuff has nothing to do with the current discussion, I need it for other reasons).


So to summarise, you need to do two things to stop warning messages about unrecognised character sets: add it to <CharsetConverters> (http://www.mhonarc.org/MHonArc/doc/resources/charsetconverters.html), and also modify your <MIMEArgs> for text/plain to add the 'asis' option. See below for an example (what I use).

As far as the action that will be taken with these character sets when you supply 'asis' as above, aside from not printing the warning message any longer, they will be dealt with (as far as I can see) in exactly the same way - simply encoded for HTML entities (<, >, ") and otherwise left unmodified. Thus this is a pretty safe thing to do AFAIK, for character sets such as windows-1252 at least, it shouldn't introduce any nasty behaviour.

For example, the relevant resources in the .rc file I use are:

<CharsetConverters>
windows-1252;   mhonarc::htmlize;
</CharsetConverters>

<MIMEFilters>
message/delivery-status;   m2h_text_plain::filter;      mhtxtplain.pl
message/partial;           m2h_text_plain::filter;      mhtxtplain.pl
text/*;                    m2h_text_plain::filter;      mhtxtplain.pl
text/enriched;             m2h_text_enriched::filter;   mhtxtenrich.pl
text/html;                 m2h_text_html::filter;       mhtxthtml.pl
text/plain;                m2h_text_plain::filter;      mhtxtplain.pl
text/richtext;             m2h_text_enriched::filter;   mhtxtenrich.pl
text/x-html;               m2h_text_html::filter;       mhtxthtml.pl
</MIMEFilters>

<MIMEArgs>
text/*: maxwidth=80
text/plain: maxwidth=80 asis=windows-1252:iso-8859-15
</MIMEArgs>

YMMV.

_______________________________________________________________________
Will Bryant, will(_at_)core-dev(_dot_)co(_dot_)nz                    cell +64 
21 655 443
http://www.core-dev.co.nz/    Personal: http://www.core-dev.co.nz/will/
ShareChat Ltd. technical manager            http://www.sharechat.co.nz/
[PGP 0x96A7F40A, FP 827F A2A9 C718 106D 8F80  E16E A244 D5F2 96A7 F40A]

<Prev in Thread] Current Thread [Next in Thread>
  • Followup regarding "Unrecognized character set: windows-1252" messages, Will Bryant <=