Overview
| Artifact ID: | 60ca85afb6a0b7ac7d9635e5c0727fffe392a7993f1f68a308879b6a753226ba |
|---|---|
| Ticket: | d10d6ddf295864389294b966163a23a58b9a1e72
UTF-16 Unicode escapes should continue to work in version 9.0 |
| User & Date: | bhaible on 2024-07-01 16:30:16 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
In Tcl 8.x, the only way to write Unicode characters in a way that is independent of the encoding of the current locale is through the \uhhhh\uhhhh syntax, where the first \uhhhh denotes a "high surrogate" and the second \uhhhh denotes a "low surrogate". See: $ tclsh8.6 % puts "\ud83d\ude03" 😃 % puts "\U0001F603" � Reference: https://www.tcl-lang.org/man/tcl8.6/TclCmd/Tcl.htm#M28 This does not work any more: $ tclsh9.0 % puts "\ud83d\ude03" error writing "stdout": invalid or incomplete multibyte or wide character % puts "\U0001F603" 😃 Reference: https://www.tcl.tk/man/tcl9.0/TclCmd/Tcl.html#M28 Use of unencoded UTF-8 characters does not work when [encoding system] is different from utf-8. But it is important to have a way to denote literal strings with Unicode characters that work - regardless of current locale, and - regardless of the Tcl version. This is important e.g. in message catalogs (such as those generated by GNU gettext). As it is now, - Unencoded UTF-8 characters don't work, because of e.g. ISO-8859-1 locales in Tcl 8.x, - \U000hhhhh doesn't work, because of Tcl 8.6, - \uhhhh\uhhhh doesn't work, because of Tcl 9.0beta2. I'm not saying that all of https://core.tcl-lang.org/tips/doc/trunk/tip/497.md is wrong. I'm only saying that the parser should recognize the special case of \uhhhh\uhhhh with a high surrogate followed by a low surrogate and convert this to a 32-bit Unicode code point.
- foundin changed to: "9.0b2"
- is_private changed to: "0"
- login: "bhaible"
- priority changed to: "5 Medium"
- private_contact changed to: "2233330cf6146dcc3447bbdcc73be6c76b5b8e35"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "bhaible"
- subsystem changed to: "45. Parsing and Eval"
- title changed to:
UTF-16 Unicode escapes should continue to work in version 9.0
- type changed to: "Bug"