GNOME Bugzilla – Bug 300115
RFC2047 encoding always separates the last non-ASCII UTF-8 character.
Last modified: 2005-08-09 05:44:43 UTC
Please describe the problem: In camel/camel-mime-utils.c:rfc2047_encode_word(), if the last unicode character in the input string is non-ASCII, it is always encoded as a separated chunk. Separating is valid in RFC2047, but separating in this case is not an intended result. Steps to reproduce: A simple test program: =============================================== #include <camel/camel-mime-utils.h> #include <stdio.h> int main (int argc, char *argv[]) { char *encoded; char *header; header = "\xed\x95\x98\xed\x95\x98\xed\x95\x98"; encoded = camel_header_encode_phrase (header); printf ("%s\n", encoded); g_free (encoded); header = "\xed\x95\x98\xed\x95\x98"; encoded = camel_header_encode_phrase (header); printf ("%s\n", encoded); g_free (encoded); } =============================================== 1. 2. 3. Actual results: $ ./test-rfc2047 =?UTF-8?Q?=ED=95=98=ED=95=98?= =?UTF-8?Q?=ED=95=98?= =?UTF-8?Q?=ED=95=98?= =?UTF-8?Q?=ED=95=98?= $ Expected results: =?UTF-8?Q?=ED=95=98=ED=95=98=ED=95=98?= =?UTF-8?Q?=ED=95=98=ED=95=98?= Does this happen every time? Always Other information:
Created attachment 45334 [details] [review] Ignores separation which does not occur between lines. This patch makes the RFC2047 encoder ignores RFC2047 separation which does not occur between lines. Someone may worry about invalid UTF-8 sequences, but the original code could never detect truncated UTF-8 sequence anyway.
adding patch keyword
does this pass the make check tests in camel/tests?
oh well, the tests pass. in future ensure you include changelog entries. i will commit this tomorrow after i've sent the patch to the list
Created attachment 50436 [details] [review] updated
naah i'll commit it now. thanks again.