.
D 2024-07-01T16:30:16.749
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment In\sTcl\s8.x,\sthe\sonly\sway\sto\swrite\sUnicode\scharacters\sin\sa\sway\sthat\sis\sindependent\r\nof\sthe\sencoding\sof\sthe\scurrent\slocale\sis\sthrough\sthe\s\\uhhhh\\uhhhh\ssyntax,\swhere\sthe\r\nfirst\s\\uhhhh\sdenotes\sa\s"high\ssurrogate"\sand\sthe\ssecond\s\\uhhhh\sdenotes\sa\s"low\ssurrogate".\r\n\r\nSee:\r\n$\stclsh8.6\r\n%\sputs\s"\\ud83d\\ude03"\r\n😃\r\n%\sputs\s"\\U0001F603"\r\n�\r\n\r\nReference:\shttps://www.tcl-lang.org/man/tcl8.6/TclCmd/Tcl.htm#M28\r\n\r\nThis\sdoes\snot\swork\sany\smore:\r\n\r\n$\stclsh9.0\r\n%\sputs\s"\\ud83d\\ude03"\r\nerror\swriting\s"stdout":\sinvalid\sor\sincomplete\smultibyte\sor\swide\scharacter\r\n%\sputs\s"\\U0001F603"\r\n😃\r\n\r\nReference:\shttps://www.tcl.tk/man/tcl9.0/TclCmd/Tcl.html#M28\r\n\r\nUse\sof\sunencoded\sUTF-8\scharacters\sdoes\snot\swork\swhen\s[encoding\ssystem]\sis\sdifferent\sfrom\sutf-8.\r\n\r\nBut\sit\sis\simportant\sto\shave\sa\sway\sto\sdenote\sliteral\sstrings\swith\sUnicode\scharacters\sthat\swork\r\n\s\s-\sregardless\sof\scurrent\slocale,\sand\r\n\s\s-\sregardless\sof\sthe\sTcl\sversion.\r\nThis\sis\simportant\se.g.\sin\smessage\scatalogs\s(such\sas\sthose\sgenerated\sby\sGNU\sgettext).\r\nAs\sit\sis\snow,\r\n\s\s-\sUnencoded\sUTF-8\scharacters\sdon't\swork,\sbecause\sof\se.g.\sISO-8859-1\slocales\sin\sTcl\s8.x,\r\n\s\s-\s\\U000hhhhh\sdoesn't\swork,\sbecause\sof\sTcl\s8.6,\r\n\s\s-\s\\uhhhh\\uhhhh\sdoesn't\swork,\sbecause\sof\sTcl\s9.0beta2.\r\n\r\nI'm\snot\ssaying\sthat\sall\sof\shttps://core.tcl-lang.org/tips/doc/trunk/tip/497.md\sis\swrong.\r\nI'm\sonly\ssaying\sthat\sthe\sparser\sshould\srecognize\sthe\sspecial\scase\sof\s\\uhhhh\\uhhhh\swith\r\na\shigh\ssurrogate\sfollowed\sby\sa\slow\ssurrogate\sand\sconvert\sthis\sto\sa\s32-bit\sUnicode\r\ncode\spoint.
J foundin 9.0b2
J is_private 0
J login bhaible
J priority 5\sMedium
J private_contact 2233330cf6146dcc3447bbdcc73be6c76b5b8e35
J resolution None
J severity Important
J status Open
J submitter bhaible
J subsystem 45.\sParsing\sand\sEval
J title UTF-16\sUnicode\sescapes\sshould\scontinue\sto\swork\sin\sversion\s9.0
J type Bug
K d10d6ddf295864389294b966163a23a58b9a1e72
U bhaible
Z c04c872e4d1001802fcf00339c887d7c