Overview
| Artifact ID: | 1ed05bb442f1512b7294fd1b78f4e50a1a94a9db616201848379216718a77306 |
|---|---|
| Ticket: | 6474fbd934378bb2a9d505f2799f9787a10a3f09
Tcl 8.7a5: why utf-8 is different? |
| User & Date: | petasis on 2022-01-14 09:05:51 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
Hi all, I observe a difference in converting strings to utf-8 between Tcl 8.6/8.7a1 and 8.7a5. In Tcl 8.6 I get: binary scan [encoding convertto utf-8 \uD800] H* hex; puts $hex > efbfbd which seems the correct utf-8 encoding. However, in Tcl 8.7a5 I get: binary scan [encoding convertto utf-8 \uD800] H* hex; puts $hex > eda080 What is the reason for this difference? Shouldn't the utf-8 bytes be the same, no matter what internal representation for strings is used by Tcl? I know that this is invalid input (and only half of a "character"), but in my view what tcl 8.6 returns makes much more sense, as there is a (very) limited usage. The behaviour in 8.7 returns a character, hiding the problem in the input... George
- foundin changed to: "8.7a5"
- is_private changed to: "0"
- login: "petasis"
- priority changed to: "5 Medium"
- private_contact changed to: "3cb4dabca0e1e7b9d560b2ca060abb67f2a97f23"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "petasis"
- subsystem changed to: "44. UTF-8 Strings"
- title changed to: "Tcl 8.7a5: why utf-8 is different?"
- type changed to: "Bug"