Overview
Artifact ID: | a3ac593dfa35367025764364e1cedba29dc72b1fd0263e57042582c4577ee511 (Awaiting Moderator Approval) |
---|---|
Ticket: | d3f66f9a756f54569caf57bbb2cade1f3d25ad06
mime::field_decode remove spaces in specific situations |
User & Date: | anonymous 2025-05-19 09:28:02 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- comment changed to:
Example from a newsletter: Subject: =?UTF-8?Q?Neuer_SPD-Generalsekret=C3=A4r_?= =?UTF-8?Q?Kl=C3=BCssendorf_warnt_Union_vor_?= =?UTF-8?Q?Konflikt_bei_Migration?= puts [::mime::field_decode [::mime::getheader $mime_data "Subject"]] results in "Neuer SPD-GeneralsekretärKlüssendorf warnt Union vorKonflikt bei Migration" it should be "Neuer SPD-Generalsekretär Klüssendorf warnt Union vor Konflikt bei Migration" Note that the whitespace is part of the encoded word. A quick-fix for me (may break some other case) was to switch order while decoding: @@ -2537,18 +2537,18 @@ proc ::mime::qp_decode {string {encoded_word 0}} { # 8.1+ improved string manipulation routines used. # Special processing for encoded words (RFC 2047) - - if {$encoded_word} { - # _ == \x20, even if SPACE occupies a different code position - set string [string map [list _ \u0020] $string] - } - + # smash the white-space at the ends of lines since that must've been # generated by an MUA. regsub -all -- {[ \t]+\n} $string \n string set string [string trimright $string " \t"] + if {$encoded_word} { + # _ == \x20, even if SPACE occupies a different code position + set string [string map [list _ \u0020] $string] + } + # Protect the backslash for later subst and # smash soft newlines, has to occur after white-space smash # and any encoded word modification.
- foundin changed to: "1.20"
- is_private changed to: "0"
- login: "anonymous"
- mimetype: "text/x-fossil-plain"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "mime"
- title changed to:
mime::field_decode remove spaces in specific situations
- type changed to: "Bug"