Overview
| Artifact ID: | 579560fddeabc345a980e83556c0e706829cff2c |
|---|---|
| Ticket: | 1317477fffffffffffffffffffffffffffffffff
clock format %c %X %Z output garbled string on Windows |
| User & Date: | kennykb on 2005-10-17 02:43:16 |
Changes
- icomment:
Logged In: YES user_id=99768 Hmm, I need to find some of my old notes here. In general, the Windows code tries to use the native Unicode interfaces wherever possible, and in any case to convert to UTF-8 as close to the system call as possible, so TcpGetTZName is supposed to return UTF-8. LOCALE_USE_CP_ACP is The Wrong Thing, since it will lose any characters that aren't on the system ANSI code page. It looks as if the right thing here will be to call GetDateFormatW if it's available (and then convert the resulting Unicode to UTF-8). On W98/Me systems that lack GetDateFormatW, we need to do TclWinTCharToUtf on the TCHAR string that's returned, and hope for the best. (Or start requiring MSLU - which would be my preference, since then Tcl at least gets a consistent API to start from.) At one point, we had a path through the code that caused double conversion (interpreting a UTF-8 string as if it were in system locale) which caused trouble. That was bug 624408, which got fixed quite some time ago by clarifying what interfaces return UTF-8. This appears to be a case that we missed.
- login: "kennykb"
- mimetype: "text/plain"
- username: "kennykb"