Artifacts Associated With Ticket b3fbd9a6e028dfa5
Ticket change [afb3da897f] (rid 250185) by chelmuth on 2026-01-06 07:18:10:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
The following code produces invalid UTF-8 strings and causes puts to abort. set padded_unicode_22c5 " \U22c5 " set trimmed_unicode_22c5 [string trim $padded_unicode_22c5] puts "padded_unicode_22c5: '$padded_unicode_22c5'" puts "trimmed_unicode_22c5: '$trimmed_unicode_22c5'" The same happens for U+2020. Most interestingly the characters are represented by UTF-8 sequences like follows. U+22C5 0xE2 0x87 0x85 U+2020 0xE2 0x80 0xA0 The first sequence contains 0x85 and the second 0x80. U+0085 (0xC2 0x85) is <Next Line> (NEL). U+0080 (0xC2 0x80) is <Padding Character> (PAD). Both should be trimmed I expect but are not in the string above (0xC2 is missing). I also tested Tcl 9.0.3, which works like a charm.
- foundin initialized to: "8.6.17"
- is_private initialized to: "0"
- login: "chelmuth"
- priority initialized to: "5 Medium"
- private_contact initialized to: "7313b123087982208eac04b14054e0c43344d79f"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "chelmuth"
- subsystem initialized to: "44. UTF-8 Strings"
- title initialized to:
string trim generates invalid utf-8 for some codepoints
- type initialized to: "Bug"
Add attachment "tclUtil.diff" [e2f1a78e88] (rid 250200) by chelmuth on 2026-01-06 11:45:36.
Ticket change [c5bbbde7bf] (rid 251848) by jan.nijtmans on 2026-03-02 20:06:09:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2461102.3376082638"
- closer changed to: "jan.nijtmans"
- icomment:
Fixed [94529656ae2d2d88|here] Thanks for the report and the patch.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"