Tcl Library Source Code

Artifact [a3ac593dfa]
Login

Artifact a3ac593dfa35367025764364e1cedba29dc72b1fd0263e57042582c4577ee511:

Ticket change [a3ac593dfa] - New ticket [d3f66f9a756f5456|d3f66f9a75] <i>mime::field_decode remove spaces in specific situations</i>. by anonymous 2025-05-19 09:28:02. (unpublished)
D 2025-05-19T09:28:02.529
J assignee nobody
J closer nobody
J comment Example\sfrom\sa\snewsletter:\r\n\r\nSubject:\s=?UTF-8?Q?Neuer_SPD-Generalsekret=C3=A4r_?=\r\n\s=?UTF-8?Q?Kl=C3=BCssendorf_warnt_Union_vor_?=\r\n\s=?UTF-8?Q?Konflikt_bei_Migration?=\r\n\r\nputs\s[::mime::field_decode\s[::mime::getheader\s$mime_data\s"Subject"]]\r\nresults\sin\r\n\r\n"Neuer\sSPD-GeneralsekretärKlüssendorf\swarnt\sUnion\svorKonflikt\sbei\sMigration"\r\n\r\nit\sshould\sbe\r\n"Neuer\sSPD-Generalsekretär\sKlüssendorf\swarnt\sUnion\svor\sKonflikt\sbei\sMigration"\r\n\r\nNote\sthat\sthe\swhitespace\sis\spart\sof\sthe\sencoded\sword.\r\nA\squick-fix\sfor\sme\s(may\sbreak\ssome\sother\scase)\swas\sto\sswitch\sorder\swhile\sdecoding:\r\n\r\n@@\s-2537,18\s+2537,18\s@@\r\n\sproc\s::mime::qp_decode\s{string\s{encoded_word\s0}}\s{\r\n\s\s\s\s\s#\s8.1+\simproved\sstring\smanipulation\sroutines\sused.\r\n\s\s\s\s\s#\sSpecial\sprocessing\sfor\sencoded\swords\s(RFC\s2047)\r\n-\r\n-\s\s\s\sif\s{$encoded_word}\s{\r\n-\s\s\s\s\s\s\s\s#\s_\s==\s\\x20,\seven\sif\sSPACE\soccupies\sa\sdifferent\scode\sposition\r\n-\s\s\s\s\s\s\s\sset\sstring\s[string\smap\s[list\s_\s\\u0020]\s$string]\r\n-\s\s\s\s}\r\n-\r\n+\r\n\s\s\s\s\s#\ssmash\sthe\swhite-space\sat\sthe\sends\sof\slines\ssince\sthat\smust've\sbeen\r\n\s\s\s\s\s#\sgenerated\sby\san\sMUA.\r\n\r\n\s\s\s\s\sregsub\s-all\s--\s{[\s\\t]+\\n}\s$string\s\\n\sstring\r\n\s\s\s\s\sset\sstring\s[string\strimright\s$string\s"\s\\t"]\r\n\r\n+\s\s\s\sif\s{$encoded_word}\s{\r\n+\s\s\s\s\s\s\s\s#\s_\s==\s\\x20,\seven\sif\sSPACE\soccupies\sa\sdifferent\scode\sposition\r\n+\s\s\s\s\s\s\s\sset\sstring\s[string\smap\s[list\s_\s\\u0020]\s$string]\r\n+\s\s\s\s}\r\n+\r\n\s\s\s\s\s#\sProtect\sthe\sbackslash\sfor\slater\ssubst\sand\r\n\s\s\s\s\s#\ssmash\ssoft\snewlines,\shas\sto\soccur\safter\swhite-space\ssmash\r\n\s\s\s\s\s#\sand\sany\sencoded\sword\smodification.
J foundin 1.20
J is_private 0
J login anonymous
J mimetype text/x-fossil-plain
J priority 5\sMedium
J resolution None
J severity Minor
J status Open
J submitter anonymous
J subsystem mime
J title mime::field_decode\sremove\sspaces\sin\sspecific\ssituations
J type Bug
K d3f66f9a756f54569caf57bbb2cade1f3d25ad06
U anonymous
Z 04cb34ab2de52d55662b156c647f4f89