* Rich <
[email protected]d>
| Alexandru <
[email protected]> wrote:
| > Recently I though it would be a good idea to add "encoding system
| > utf-8" to my code.
| Will only work right if the OS system call encoding is also UTF-8.
| > After that I realized that the icons of Windows folders in the
| > treectrl package are not shown anymore, if the folder path contains
| > special chars such as umlaute. So I must revert back.
| Yup, expected, as windows system calls are likely largely still UTF-16.
I'm not convinced that this is the real reason for that error.
In my experience, the file handling functions on Windows don't care
about the system encoding when it comes to the *name* of the file - they
simply convert TCL's internal rep to wide char (win/tclWinFile.c:TclNativeCreateNativeRep(), using
MultiByteToWideChar() from CP_UTF8).
In contrast, the code on unix indeed uses the system encoding to get the
file name to open (unix/tclUnixFile.c:TclNativeCreateNativeRep() uses Tcl_UtfToExternalDString(NULL,) where the NULL denotes the system
encoding).
I rather suspect that the file *reading* behind the scenes relies on the
system encoding being 'correct'. That might fail if the system encoding
ist set to utf-8, but the file content is not stored in utf-8.
R'
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)