international chars in tcl/tk can't be handle <p>I use tcl shellicon command to extract icons, as it mentioned on wiki page below, there are some international character problems in it, then I write some code to test but it doesn't work, could anyone to help me correct it.</p> <pre><code>/* * testdll.c * gcc compile: gcc testdll.c -ltclstub86 -ltkstub86 -IC:\Users\L\tcc\include -IC:\Users\L\tcl\include -LC:\Users\L\tcl\lib -LC:\Users\L\tcc\lib -DUSE_TCL_STUBS -DUSE_TK_STUBS -shared -o testdll.dll */ #include &lt;windows.h&gt; #include &lt;tcl.h&gt; #include &lt;stdlib.h&gt; int TestdllCmd(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]) { char * path; Tcl_DString ds; if (objc &gt; 2) { Tcl_SetResult(interp, "Usage: testdll ?path?",NULL); return TCL_ERROR; } if (objc == 2) { path = Tcl_GetString(objv[objc-1]); path = Tcl_TranslateFileName(interp, path, &amp;ds); if (path != TCL_OK) { return TCL_ERROR; } } Tcl_AppendResult(interp, ds, NULL); return TCL_OK; } int DLLEXPORT Testdll_Init(Tcl_Interp *interp) { if (Tcl_InitStubs(interp, "8.5", 0) == NULL) { return TCL_ERROR; } Tcl_CreateObjCommand(interp, "testdll", TestdllCmd, NULL, NULL); Tcl_PkgProvide(interp, "testdll", "1.0"); return TCL_OK; } </code></pre> <p>I compile it with:</p> <pre><code>gcc compile: gcc testdll.c -ltclstub86 -ltkstub86 -IC:\Users\USERNAME\tcc\include -IC:\Users\USERNAME\tcl\include -LC:\Users\USERNAME\tcl\lib -LC:\Users\USERNAME\tcc\lib -DUSE_TCL_STUBS -DUSE_TK_STUBS -shared -o testdll.dll </code></pre> <p>windows cmd shell run: tclsh testdll.tcl</p> <pre><code>load testdll puts [testdll C:/Users/L/桌面] </code></pre> <p>the output is:</p> <pre><code>// This line isn't in the output, just to show the first line of output is a *EMPTY LINE* while executing "testdll 'C:/Users/L/桌面'" invoked from within "puts [testdll 'C:/Users/L/桌面']" (file "testdll.tcl" line 2) </code></pre> <p>In fact, I want to print a line, whose content is "C:/Users/L/桌面"</p> <p>I write this dll to debug how to replace Tcl_GetString,Tcl_TranslateFileName with Tcl_FSGetNormalizedPath, Tcl_FSGetNativePath, I wonder if it's clear?</p> <p>Thank you!</p>