: <i> "fconfigure stdout -encoding utf-8" failed on windows</i> plus 8 other changes
by
.
D 2013-05-07T16:11:59
J closedate 2013-05-07T09:11:59
J closer dkf
J icomment \n\nallow_comments\s-\s1\n\nTclsh\son\sWindows\sis\ssupposed\sto\sbe\sable\sto\stalk\sdirectly\sto\sthe\sconsole\s(as\sUnicode,\susing\sa\sWin-native\sAPI)\sso\sthere\sshould\sbe\sno\sneed\sto\sever\sset\sthe\sencoding\son\sthe\sstdout\schannel\sthere,\snot\sunless\sit\shas\sbeen\sredirected\sto\sa\sfile\s(when\sit\sshould\swork).\sI'm\snot\sreally\ssurprised\sthat\sbad\sthings\shappen\swhen\syou\stry\sthis,\sthough\sthe\sparticular\scombination\sis\s"curious"\s(it\sappears\sto\sbe\sinterpreting\sthe\stwo\sbytes\sof\sthe\sencoding\sof\sthe\sprompt,\s0x25\sfollowed\sby\s0x20,\sas\sthe\scharacter\s\\u2025\s-\sit's\slittle-endian\s-\swhich\sis\sthat\stwo-dot\schar).\sIf\syou'd\sgot\sTcl\sto\s[puts\s"Hello,\sWorld!"]\sor\ssomething\slike\sthat,\syou'd\shave\sseen\sother\s"interesting"\schars\s(Chinese,\sI\sthink).\n\n\s\s%\sencoding\sconvertfrom\sunicode\s[encoding\sconvertto\sutf-8\s"%\s"]\n\s\s‥\n\s\s%\sencoding\sconvertfrom\sunicode\s[encoding\sconvertto\sutf-8\s"Hello,\sWorld!"]\n\s\s效汬Ɐ圠牯摬\n\nThe\sfix?\sDon't\schange\s-encoding\swhen\sstdout\sis\sa\sterminal.\s("Doctor!\sIt\shurts\swhen\sI\sprod\sa\sknife\sin\smy\seye!"\s"Well\sstop\sdoing\sthat\sthen!")\n
J login dkf
J mimetype text/plain
J resolution Invalid
J status Closed
J subsystem 27.\sChannel\sTypes
J username dkf
K 3612458fffffffffffffffffffffffffffffffff
U dkf
Z 949c901f5a79385106c517dae7355c7c