[patch] treatment of wrongly encoded 8-bit messages



Here is my 2nd approach to improve the handling of broken 8-bit messages 
with missing MIME headers in balsa 2 (against today's cvs; see details 
below...). It now offers some flexibility, but it's not a one-liner 
anymore...

Basically, there is a new config option (in display->message) to select 
either the current method (replace all 8-bit chars by "?") or to assume a 
codeset like west european, east european, etc. If a broken message is 
displayed, the contents is checked for characters in the range 0x80..0x9f 
which indicate a winbloze (not iso) codeset (thanks again to Jeffrey 
Stedfast for his hints!!). The text is then converted to utf8 using the 
"best" encoding for the selected codeset. If this fails, balsa falls back 
to the "?" method.

In any case, a warning is emitted using the libbalsa_information() methods.

Any comments are welcome!!

Cheers, Albrecht.


Patched files are---

* libmutt/handler.c: leave messages without MIME headers untouched (back 
to mutt's default)

* libbalsa/misc.[hc]: patch routine libbalsa_utf8_sanitize to do the 
conversion, plus a static to select win or iso encoding

* libbalsa/libbalsa.h: enumeration of codesets (I'm sure it's not complete 
yet!!)

* src/balsa-app.h: two new config vars (try to convert, used codeset)

* src/pref-manager.c: display them in the prefs window

* src/save-restore.c: save & restore them

* src/balsa-message.c: use the new feature :-))

* src/balsa-index.c: inserted dummy vars due to the changed interface

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Albrecht Dreß  -  Johanna-Kirchner-Straße 13  -  D-53123 Bonn (Germany)
        Phone (+49) 228 6199571  -  mailto:albrecht.dress@arcor.de
_________________________________________________________________________

balsa2-msgcodeset-patch.gz



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]