D 2020-05-11T16:57:42.678 J comment
Dear\sRoy,
thank\syou\sfor\sgreat\sKitCreator.\sThis\sis\sanother\sticket\sin\sthe\sseries\sof\sthis\sWiki\spage:
[https://wiki.tcl-lang.org/page/Embedding+TCL+program+in+DLL?V=28].
In\sfolder:
kitCreator/kitsh/buildsrc/kitsh0.0
File\skitInit.c,\sLine\s392:
<verbatim>
Tcl_SetVar(interp,\s"tclkit_system_encoding",\sTcl_DStringValue(&encodingName),\s0);
</verbatim>
For\sme,\sthe\slast\sparameter\sshould\sbe\schanged\sfrom\s"0"\sto\s"TCL_GLOBAL_ONLY"\sto\smake\sthe\svariable\s"tclkit_system_encoding"\svisible\sfor\sboot.tcl.
File\sboot.tcl,\sLine\s103:
"encoding\ssystem"\sis\schecked\sfor\sresult\s"identity"\sas\sa\ssign,\sthat\sthe\ssystem\sencoding\sis\snot\sset.
Since\stcl\s8.6.0,\sthe\sdefault\sis\s"iso8859-1"\sand\snot\s"identity".
Thus,\sI\spropose\sto\schange\sthe\scode\s(perhaps\sonly\sfor\stcl\s8.6.x)\sto:
<verbatim>
if\s{[info\sexists\s::tclkit_system_encoding]\s&&\s$::tclkit_system_encoding\s!=\s""\s&&\s[encoding\ssystem]\sne\s$::tclkit_system_encoding\s}\s{   \scatch\s{   \s   \sencoding\ssystem\s$::tclkit_system_encoding   \s}}
</verbatim>
This\sworks\sfor\sme\sto\schange\sthe\ssystem\sencoding\sto\s"cp1252"\susing\sa\sC-VFS\swithin\sa\sDLL.
Another\schange\smay\sbe\sdone\sto\sthe\slines\sjust\safter\sthis\sblock:
<verbatim>
#\sIf\swe've\sstill\snot\sbeen\sable\sto\sset\sthe\sencoding,\srevert\sto\sTclkit\sdefaultsif\s{[encoding\ssystem]\seq\s"identity"}\s{   \scatch\s{   \s   \sswitch\s$::tcl_platform(platform)\s{   \s   \s   \swindows   \s   \s{\sencoding\ssystem\scp1252\s}   \s   \s   \smacintosh   \s{\sencoding\ssystem\smacRoman\s}   \s       \sdefault   \s   \s{\sencoding\ssystem\siso8859-1\s}   \s   \s}   \s}}
</verbatim>
I\ssuppose,\sthe\splatform\s"macintosh"\shas\schanged\sto\s"darwin".\sAs\sutf-8\sis\snow\sthe\sdefault\sfor\smac\sand\smany\sUnix\s(which\sis\san\salways\spresent\sinternal\sencoding),\sthis\sblock\smay\sperhaps\sbe\sremoved\sentirely.
What\sdo\syou\sthink\s?
Thank\syou\sfor\sall,
Harald
J foundin trunk J login anonymous J private_contact 0f366eb3e9e2fcab52b8ebacd197db9047186a5f J severity Minor J status Open J title Kit:\sboot.tcl\suses\sencoding\s"identity"\sinstead\s"iso8859-1"\ssince\s8.6.0,\skitInit.c\sTCL_GLOBAL\sscope\smissing J type Code\sDefect K 570aa112299e92f023ec03ae226e4cbd797c55b8 U anonymous Z c14c159a3968e134c1533b709a0a75be