Skip to content
Tcl Source Code History Of Ticket 1317477fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1317477fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1317477fffffffffffffffffffffffffffffffff

  1. Ticket change [fc0c2f6bb7] (rid 108164) by nobody on 2005-10-08 08:29:39:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      ActiveTcl8.4.11
      Windows2000(Japanese)
      
      clock format 0 -format %Z
      clock format 0 -format %X
      clock format 0 -format %c
      clock format 0 -format %x
      
      clock format %c, %X and %Z output garbled string.
      I read source code and found points of problems.
      Next is details.
      
      %Z
      compat/strftime.c use multi-byte string.
      But Windows TclpGetTZName returned UTF8 string.
      And this string wasn't converted to muiti-byte.
      
      %c %x %X
      we should use LOCALE_USE_CP_ACP flag at GetDateFormat
      in compat/strftime.c.
      If system language wasn't same as locale option language,
      clock format %c and %X output garbled string.
      Of cource, this is a rare case, and if windows could not 
      map locale encoding to system encoding, then we get
      garbled string after all....
      
      
      I' wrote patch for compat/strftime.c. please see it too.
      thanks
      
    4. foundin initialized to: "obsolete: 8.4.11"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "16. Commands A-H"
    10. title initialized to:
      clock format %c %X %Z output garbled string on Windows
      
    11. type initialized to: "Bug"
  2. Add attachment "strftime.patch" [37c3bdcb9e] (rid 112086) by nobody on 2005-10-08 15:29:39.

  3. Ticket change [f5889c792b] (rid 130128) by nobody on 2005-10-08 15:29:39:

    1. icomment:
      
      
      File Added - 151741: strftime.patch
      
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  4. Ticket change [9a056ea15b] (rid 110887) by dkf on 2005-10-10 05:36:32:

    1. assignee changed to: "kennykb"
    2. subsystem changed to: "06. Time Measurement"
  5. Ticket change [579560fdde] (rid 94512) by kennykb on 2005-10-17 02:43:16:

    1. 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.
      
      
    2. login: "kennykb"
    3. mimetype: "text/plain"
    4. username: "kennykb"
  6. Ticket change [f592a48d9b] (rid 130137) by nobody on 2005-10-20 03:18:39:

    1. icomment:
      Logged In: NO 
      
      thank you kennykb.
      
      %c %x %X
      I thught that even if we got unicode, we must return it 
      as multi-byte in strftime. It seemed to me that it was better 
      than all garbage string. well, I entrust you entirely...orz
      
      %Z
      I checked Bug 624408 for a short time ago. thanks.
      now 8.4.11, I can convert %Z format string to 
      non-garbage string on tcl like this.
      % set Z [clock format 0 -format %Z]
      % encoding convertfrom utf-8 [encoding convertto [encoding
      system] $Z]
      
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  7. Ticket change [9a6b3d529e] (rid 110938) by kennykb on 2005-11-05 01:18:33:

    1. closedate changed to: "2005-11-04T18:18:33"
    2. closer changed to: "kennykb"
    3. icomment:
      Logged In: YES 
      user_id=99768
      
      I distinctly remember fixing this bug once before.  But the
      fix wasn't
      in the code.  I suspect that I fixed it on the 8.5 branch,
      and then
      eliminated TclpStrftime from that branch before I backported the
      fix.  If so, that was downright slovenly.
      
      Your patch looked nearly correct.  TclpGetTZName is supposed
      to return UTF-8 on all platforms, so I eliminated the bit that
      checked for WIN32.
      
      Fix is only in core-8-4-branch; 8.5 works already.
      
      
      
    4. login: "kennykb"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "kennykb"