Bug#248827: balsa: incorrect fallback encoding

Damyan Ivanov (at work) "Damyan Ivanov \(at work\)" <divanov@creditreform.bg>, 248827@bugs.debian.org
Thu, 13 May 2004 12:53:50 +0300


This is a multi-part MIME message sent by reportbug.

--===============0470185755==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: balsa
Version: 2.0.17-2
Severity: minor
Tags: patch

Hi,

I can't make balsa to properly detect cp1251 in messages without
specified encoding in headers.


What I did:

Open Settings->Preferences.
Choose Display, choose Message

In 'National (8-bit) characters in broken messages...' choose 'display
using codeset'.

Now look at the available codesets. There is no cp1251
(Windows-1251/Wincows-Cyrillic). There is 'cyrillic (iso/windows)'. I
selected it, but any cp1251-encoded  message without proper encoding in
headers is displayed as iso-8859-5 (as seen in the warning about
conversion message).


I toke a look in the source and the problem appears to be in
libbalsa/misc.c:1118. In function libbalsa_get_codeset_name there is
assumption that windows' codesets contain characters in range 0x80-0x9f.
This is not true for windows-1251, which contains cyrilics in the range
0xC0-0xFF. Looking at 1250-1257 codesets, they all mainly use the range
0xC0-0xFF for letters...

So the destinction upon using 0x80-0x9f is wrong.

The only way I see for fixing this is to display all available encodings
in fallback codeset menu, and avoid the guesswork.
      
Patch attached. Windows' codesets just added in the end of the list,
some reordering and cleanup may be appropriate. I've avoided cleaning up
to keep the patch small.


Thanks,
dam


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.5
Locale: LANG=bg_BG.UTF-8, LC_CTYPE=bg_BG.UTF-8

Versions of packages balsa depends on:
ii  gsfonts                   8.14-3         Fonts for the Ghostscript interpre
ii  libart-2.0-2              2.3.16-5       Library of functions for 2D graphi
ii  libaspell15               0.50.5-2       The GNU Aspell spell-checker runti
ii  libatk1.0-0               1.6.0-2        The ATK accessibility toolkit
ii  libaudiofile0             0.2.6-3        Open-source version of SGI's audio
ii  libbonobo2-0              2.6.0-1        Bonobo CORBA interfaces library
ii  libbonoboui2-0            2.6.0-1        The Bonobo UI library
ii  libc6                     2.3.2.ds1-12   GNU C Library: Shared libraries an
ii  libesd-alsa0 [libesd0]    0.2.29-1       Enlightened Sound Daemon (ALSA) - 
ii  libesmtp5                 1.0.3-1        LibESMTP SMTP client library
ii  libfontconfig1            2.2.2-2        generic font configuration library
ii  libfreetype6              2.1.7-2        FreeType 2 font engine, shared lib
ii  libgail-common            1.4.1-1        GNOME Accessibility Implementation
ii  libgail17                 1.4.1-1        GNOME Accessibility Implementation
ii  libgal2.0-6               1.99.11-1      G App Libs (run time library)
ii  libgconf2-4               2.6.1-1        GNOME configuration database syste
ii  libgcrypt1                1.1.12-4       LGPL Crypto library - runtime libr
ii  libglade2-0               1:2.3.6-4      Library to load .glade files at ru
ii  libglib2.0-0              2.4.1-1        The GLib library of C routines
ii  libgnome2-0               2.6.0-4        The GNOME 2 library - runtime file
ii  libgnomecanvas2-0         2.6.0-3        A powerful object-oriented display
ii  libgnomeprint2.2-0        2.6.0-1        The GNOME 2.2 print architecture -
ii  libgnomeprintui2.2-0      2.4.2-2        The GNOME 2.2 print architecture U
ii  libgnomeui-0              2.6.0-8        The GNOME 2 libraries (User Interf
ii  libgnomevfs2-0            2.6.0-4        The GNOME virtual file-system libr
ii  libgnomevfs2-common       2.6.0-4        The GNOME virtual file-system libr
ii  libgnutls7                0.8.12-5       GNU TLS library - runtime library
ii  libgpg-error0             0.7-1          library for common error values an
ii  libgpgme11                0.4.6-1        GPGME - GnuPG Made Easy
ii  libgtk2.0-0               2.4.1-1        The GTK+ graphical user interface 
ii  libgtkhtml3.0-4           3.0.10-1       HTML rendering/editing library - r
ii  libice6                   4.3.0.dfsg.1-1 Inter-Client Exchange library
ii  libjpeg62                 6b-9           The Independent JPEG Group's JPEG 
ii  libldap2                  2.1.29-2       OpenLDAP libraries
ii  libltdl3                  1.5.6-1        A system independent dlopen wrappe
ii  liborbit2                 1:2.10.0-0.1   libraries for ORBit2 - a CORBA ORB
ii  libpango1.0-0             1.4.0-1        Layout and rendering of internatio
ii  libpcre3                  4.5-1.1        Perl 5 Compatible Regular Expressi
ii  libpopt0                  1.7-4          lib for parsing cmdline parameters
ii  libsm6                    4.3.0.dfsg.1-1 X Window System Session Management
ii  libssl0.9.7               0.9.7d-2       SSL shared libraries
ii  libtasn1-0                0.1.2-2        Manage ASN.1 structures (runtime)
ii  libx11-6                  4.3.0.dfsg.1-1 X Window System protocol client li
ii  libxml2                   2.6.9-2        GNOME XML library
ii  scrollkeeper              0.3.14-8       A free electronic cataloging syste
ii  xlibs                     4.3.0.dfsg.1-1 X Window System client libraries m
ii  zlib1g                    1:1.2.1-5      compression library - runtime

-- no debconf information

--===============0470185755==
Content-Type: application/octet-stream
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="balsa-2.0.17+all-codesets.patch.gz"

H4sIALBDo0AAA41YW2/aShB+Lr9ixEMFwQ6+hkvbo5AUNZxwkgqCoqOjChl7CS5kjXwRqar+97Pr
GzuLgeQBe3e+mR3PfDuzm0e6+QU+hYWziRzVuNQu9U4/G11GW+LWPH+5BDUENUGY9sZfpOP2qx+5
ly4s/TfiqacgNVVVT9r4YGiaqeqGampg6H1d62vmpVb8QUtj8lqr1XrHWtyUpWq2qpug632r17d7
yJTJTF1fg6rrmq1cQSt96hZcX9cg+3uYjccK1Hc+9YJdxNyyO3UlnxV+MXz/C38+1aDWimIn9l14
cVdOCBfOZjN3A49EJI7+G49ubgbj6WD+MPtnfvv4dTgdPk1/wJdaKzX4G+p+FKjdrt1TdbbyfmSg
kYlGFhrZbJSbA2H6CoE6aNRFox4a6VpdqTCnY/d07JGOXdK5T/V14KvdULSWziRcRhJX/bkt3tZh
HWfBkMbIJ2Fel3BX0tiUxvYRO1ZdZgFPbasG7QuW+wuYkDgJKcQrAtR5JRAswYE8yeC4bhB6Pn2B
OIDbbPISRkuI32LwI6BBnHPGj1JrbC5yHUq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