GNOME Bugzilla – Bug 322125
quoted-printable not decoded correctly
Last modified: 2013-09-14 16:49:26 UTC
Version details: 1.5.2 Distribution/Version: Ubuntu Dapper Forwarded from: http://bugzilla.ubuntu.com/show_bug.cgi?id=18040 In the evolution-data-server package is a bug in the decoding of quoted-printable encoded strings in vcards. UTF-8 characters are in QUOTED-PRINTABLE encoded as =XX=XX where XX is a byte of 8 bits. Zürich is encoded as Z=C3=BCrich If we have a ü (=C3=BC) then: else if (isxdigit(a) && isxdigit (b)) { // a is 'C' and b is '3' gunichar c; // gunichar is wrong, because we have 0xC3 whats only 8 bits: char c; a = tolower (a); b = tolower (b); c = (((a>='a'?a-'a'+10:a-'0')&0x0f) << 4) | ((b>='a'?b-'a'+10:b-'0')&0x0f); g_string_append_unichar (str, c); // we have to append only a 8 bit char not a 16 bit unichar. // -> the next 8 bits 0xBC are added at the next iteration of the while loop. }
Created attachment 55075 [details] [review] decoding of quoted-printable encoded strings
Comment on attachment 55075 [details] [review] decoding of quoted-printable encoded strings patch by Felix Egli <felix.egli@goldnet.ch>
also see bug 320237; confirming
same patch, so marking as duplicate. *** This bug has been marked as a duplicate of 320237 ***