Skip to content
Tcl Source Code Artifact [d5a20a6c8f]
Login

Artifact [d5a20a6c8f]

Artifact d5a20a6c8fdf9bf78221e6a7c8f4b9552518d545f2fbd413e59c1d0eeeed820e:

Ticket change [d5a20a6c8f] - New ticket [5fca83d78cf37b70|5fca83d78c] <i>[encoding system] is wrong in an ISO-8859-1 locale</i>. by bhaible on 2024-07-01 18:34:20.
D 2024-07-01T18:34:20.445
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment On\sa\sLinux/glibc\ssystem,\sI\shave\stwo\sFrench\slocales:\r\n$\sLC_ALL=fr_FR.UTF-8\slocale\scharmap\r\nUTF-8\r\n$\sLC_ALL=fr_FR.ISO-8859-1\slocale\scharmap\r\nISO-8859-1\r\n\r\n('locale\scharmap'\sis\sthe\scommand-line\sequivalent\sof\snl_langinfo(CODESET).)\r\n\r\nIn\sTcl,\s[encoding\ssystem]\sshould\sbe\sset\sto\san\sequivalent\svalue,\sotherwise\r\nstrings\swith\snon-ASCII\scharacters\sare\sprinted\sincorrectly\sto\sstandard\soutput.\r\n\r\nThis\sworks\sin\sTcl\s8.6:\r\n\r\n$\sLC_ALL=fr_FR.UTF-8\stclsh8.6\r\n%\sencoding\ssystem\r\nutf-8\r\n\r\n$\sLC_ALL=fr_FR.ISO-8859-1\stclsh8.6\r\n%\sencoding\ssystem\r\niso8859-1\r\n\r\nBut\sit\sdoes\snot\swork\sfor\sthe\sISO-8859-1\slocale\sany\smore\sin\sTcl\s9.0\sbeta2:\r\n\r\n$\sLC_ALL=fr_FR.UTF-8\stclsh9.0\r\n%\sencoding\ssystem\r\nutf-8\r\n\r\n$\sLC_ALL=fr_FR.ISO-8859-1\stclsh9.0\r\n%\sencoding\ssystem\r\nutf-8\r\n\r\nI\sdebugged\sit.\snl_langinfo(CODESET)\scomes\sout\sas\s"ISO-8859-1".\r\nThis\sstring\sis\slowercased,\sproducing\s"iso-8859-1",\sand\sthen\sa\slookup\sin\r\nLocaleTable\sis\sdone,\sin\sfunction\sSearchKnownEncodings.\sThe\stable\r\nhappens\sto\shave\s174\selements,\sand\sthe\s"iso-8859-1"\sis\sat\sindex\s80.\r\nDue\sto\sa\slogic\sbug\sin\sfunction\sSearchKnownEncodings,\sthis\sindex\sis\snot\sfound.\r\nSearchKnownEncodings\sthen\sreturns\sNULL.\r\n\r\nThe\sattached\spatch\sfixes\sthe\sbug.\sThe\sbug\sis\spresent\ssince\s2005,\sbut\r\ntriggered\son\sdifferent\sencodings,\sbecause\sof\sthe\sinfluence\sof\sthe\stable\r\nlength\sand\sthe\ssearched\sentry's\sindex.
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 38.\sInit\s-\sLibrary\s-\sAutoload
J title [encoding\ssystem]\sis\swrong\sin\san\sISO-8859-1\slocale
J type Patch
K 5fca83d78cf37b70d3e958897b542f985f2ce56a
U bhaible
Z db70c17b3e0bed0d52558f696bfb57aa