GNOME Bugzilla – Bug 99873
crash when sending mail with non-default charset in ja locale
Last modified: 2006-06-18 05:24:51 UTC
Start pan-0.13.2 in ja locale: | % LANG=ja_JP.eucJP pan Then reply to a posting by mail. Enter some Japanese text or a Euro symbol, and change the message encoding to UTF-8 in the More Headers tab. Press the send mail button: | ** (pan:21156): WARNING **: Invalid UTF8 string passed to pango_layout_set_text() | | | zsh: segmentation fault pan
I just tried with pan-0.13.2.90-nospell1 and the problem still seems to be present there.
Could you provide a backtrace as described at http://pan.rebelbase.com/bugs/ ?
Created attachment 12650 [details] crash backtrace
I can reproduce this with a different backtrace:
+ Trace 31319
will look into this tomorrow.
Pearls of wisdom from fejj: <fejj> if you do printf ("%.*s", num_bytes_to_print, jp_locale_string); it will not do what you expect, instead of using that number of bytes - glibc will use that number of glyphs (characters - even if they are multibyte) <chris> charles: this causes http://bugzilla.gnome.org/show_bug.cgi?id=99873 <fejj> so what we did in evo was to make a temp buffer strcpy'd it into the tmp buffer and then did printf ("%s", tmp); <fejj> so... tmp = alloca (num_bytes_to_print + 1); memcpy (tmp, jp_locale_string, num_bytes_to_print); tmp[num_bytes_to_printf] = '\0'; printf ("%s", tmp);
Background information on using "%.*s" on other charsets: http://bugzilla.redhat.com/bugzilla/long_list.cgi?buglist=70518
Fixed in CVS for 0.13.3: http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan&command=DIFF_FRAMESET&file=ChangeLog&rev1=1.1609&rev2=1.1610&root=/cvs/gnome http://cvs.gnome.org/bonsai/cvsview2.cgi?diff_mode=context&whitespace_mode=show&subdir=pan/pan&command=DIFF_FRAMESET&file=smtp.c&rev1=1.76&rev2=1.77&root=/cvs/gnome