.
D 2016-11-07T23:03:09.966
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment in\sthe\sfollowing\sexample,\son\sa\sLinux\ssystem,\swhere\sfilesystems\sare\r\nencoding-free,\sthe\sfile\sis\sonly\sopened\swhen\sthe\sTcl\ssystem\sencoding\sis\r\niso8859-1.\s\sFurthermore,\swhen\sthe\sline\r\n\r\n<code><verbatim>set\sname\s$directory/[lindex\s$names\s0]</verbatim></code>\r\n\r\nis\smoved\sout\sof\sthe\sloop,\sthe\sfile\sis\snot\ssuccessfully\sopened\sat\sall.\r\n\r\n<code><verbatim>\r\nset\ssysencoding_orig\s[encoding\ssystem]\r\n\r\nset\sname0\s"funky\s\\xa2\sname"\r\n\r\n#\sSet\sup\sfor\sthe\sdemonstration\sof\sthe\sbug\sby\screating\sa\sfile\swhose\sname\sis\r\n#\sexactly\sthe\sbytes\sin\sthe\sstring\sbelow\r\nclose\s[open\s$name0\swb]\r\n\r\nset\sdirectory\s[pwd]\r\nset\snames\s[glob\s-directory\s$directory\s-tails\s*]\r\nforeach\sencoding\s[list\s$sysencoding_orig\siso8859-1]\s{\r\n\tencoding\ssystem\s$encoding\s\r\n\tset\sname\s$directory/[lindex\s$names\s0]\r\n\tputs\s[list\s{globbed\sname\sidentical?}\s[expr\s{$name0\seq\s$name}]]\r\n\ttry\s{\r\n\t\tset\schan\s[open\s$name]\r\n\t\tencoding\ssystem\s$sysencoding_orig\r\n\t\tputs\s[list\s{opened\swith\ssystem\sencoding}\s$encoding]\r\n\t\tclose\s$chan\r\n\t}\son\serror\s{cres\scopts}\s{\r\n\t\tputs\s[list\s{failed\sto\sopen\swith\ssystem\sencoding}\s$encoding]\r\n\t}\r\n}\r\nencoding\ssystem\s$sysencoding_orig\r\n</verbatim></code>
J foundin 8.6.7
J is_private 0
J login pooryorick
J priority 5\sMedium
J resolution None
J severity Important
J status Open
J submitter pooryorick
J subsystem 16.\sCommands\sA-H
J title [glob],\s[encoding\ssystem]\sand\sencoding-free\sfilesystems
J type Bug
K 79614fb8b61983ac8ef30ea8752c310465798fc7
U pooryorick
Z 5a2904b3885d022b6f70a52a5fc8f559