Skip to content
Tcl Source Code History Of Ticket 1256872fffffffff
Login

History Of Ticket 1256872fffffffff

Artifacts Associated With Ticket 1256872fffffffff

  1. Ticket change [de987d5bc5] (rid 114879) by a_kovalenko on 2005-08-11 16:34:19:

    1. assignee initialized to: "andreas_kupries"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      This patch, prepared agains the recent TCL8.5 CVS,
      makes the Win32 console channel driver use ReadConsoleW
      and WriteConsoleW where these functions are available
      (NT/2k/XP/2003), without (hopefully) breaking anything
      on other systems. TclWinOpenConsoleChannel will set the
      channel encoding to unicode when appropriate; thus all
      the applications that do gets/puts on the console,
      without resetting its options, will not notice any
      difference.
      
      Please let me know if such a change requires a TIP to
      be included.
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "a_kovalenko"
    9. subsystem initialized to: "27. Channel Types"
    10. title initialized to: "Unicode support for Win32 (NT) console channels"
    11. type initialized to: "Patch"
  2. Add attachment "tcl-winunicon.patch" [abf5b65aae] (rid 101207) by a_kovalenko on 2005-08-11 23:34:21.

  3. Ticket change [574cd41e07] (rid 94466) by a_kovalenko on 2005-08-11 23:34:23:

    1. icomment:
      
      
      File Added - 145280: tcl-winunicon.patch
      
      
      
    2. login: "a_kovalenko"
    3. mimetype: "text/plain"
    4. username: "a_kovalenko"
  4. Ticket change [d0e0c0bd21] (rid 113263) by dgp on 2005-08-12 00:51:48:

    1. icomment:
      Logged In: YES 
      user_id=80530
      
      
      How does is this patch related to
      Tcl RFE 491789 ?
      
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. username: "dgp"
  5. Ticket change [e16a87dc73] (rid 87441) by a_kovalenko on 2005-08-12 01:19:29:

    1. icomment:
      Logged In: YES 
      user_id=241496
      
      Tcl RFE 491789 is unrelated to this patch (though I was
      thinking, while submitting this patch, about GetCommandLineW
      as a next step to better unicode support).
      
      This patch is not about command-line parameters, it's about
      console I/O (i.e stdin, stdout, and stderr of tclsh.exe). As
      TCL already has a separate channel driver for Win32 console,
      the required changes are minimal and they don't affect
      neither TCL API nor signature of Tcl_Main.
      
      
    2. login: "a_kovalenko"
    3. mimetype: "text/plain"
    4. username: "a_kovalenko"
  6. Ticket change [783c09a45f] (rid 89925) by hobbs on 2005-08-12 04:16:48:

    1. assignee changed to: "davygrvy"
    2. icomment:
      Logged In: YES 
      user_id=72656
      
      I think this is a candidate for 8.4 and 8.5 (no compat issues).
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. priority changed to: "7 High"
    6. username: "hobbs"
  7. Ticket change [488c256776] (rid 99903) by davygrvy on 2005-08-16 11:46:22:

    1. assignee changed to: "hobbs"
    2. icomment:
      Logged In: YES 
      user_id=7549
      
      I haven't seen the guts of the patch yet, but this gets my
      vote of approval.  I can't do the work of the test/commit
      due to my lack of dev tools on this new computer of mine.. 
      passing to JH
      
      
    3. login: "davygrvy"
    4. mimetype: "text/plain"
    5. username: "davygrvy"
  8. Ticket change [daa9dc4b59] (rid 107829) by a_kovalenko on 2005-08-24 05:43:27:

    1. icomment:
      Logged In: YES 
      user_id=241496
      
      Sorry to all,
      There was a typo in the first variant of this patch
      (ReadConsoleW and WriteConsoleW were mistakenly used on
      non-unicode systems).
      Fixed (new variant attached).
      
      
    2. login: "a_kovalenko"
    3. mimetype: "text/plain"
    4. username: "a_kovalenko"
  9. Add attachment "tcl-winunicon2.patch" [d402ff8e47] (rid 123373) by a_kovalenko on 2005-08-24 05:43:27.

  10. Ticket change [ddbed3f9a9] (rid 114726) by a_kovalenko on 2005-08-24 05:43:35:

    1. icomment:
      
      
      File Added - 146736: tcl-winunicon2.patch
      
      
      
    2. login: "a_kovalenko"
    3. mimetype: "text/plain"
    4. username: "a_kovalenko"
  11. Ticket change [89dfabed6a] (rid 127300) by patthoyts on 2005-11-03 08:18:39:

    1. closedate changed to: "2005-11-03T01:18:39"
    2. closer changed to: "patthoyts"
    3. icomment:
      Logged In: YES 
      user_id=202636
      
      Works fine for me. Test suite passes and now the console can
      output cyrillic chars and so on.
      Seeing the positive comments from david - applied.
      
      
    4. login: "patthoyts"
    5. mimetype: "text/plain"
    6. resolution changed to: "Accepted"
    7. status changed to: "Closed"
    8. username: "patthoyts"
  12. Ticket change [9777df2a7c] (rid 106493) by dkf on 2005-11-03 16:08:56:

    1. assignee changed to: "patthoyts"
    2. icomment:
      Logged In: YES 
      user_id=79902
      
      Backport to 8.4 needed
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. priority changed to: "8"
    6. status changed to: "Open"
    7. username: "dkf"
  13. Add attachment "tcl-winunicon2-8-4.patch" [afef2489d6] (rid 97903) by a_kovalenko on 2005-11-03 17:10:07.

  14. Ticket change [a427c3ed3f] (rid 110162) by a_kovalenko on 2005-11-03 17:10:07:

    1. icomment:
      Logged In: YES 
      user_id=241496
      
      Backport done (tcl-winunicon2-8-4.patch).
      
      
      
    2. login: "a_kovalenko"
    3. mimetype: "text/plain"
    4. username: "a_kovalenko"
  15. Ticket change [222edf957a] (rid 130702) by a_kovalenko on 2005-11-03 17:10:08:

    1. icomment:
      
      
      File Added - 154878: tcl-winunicon2-8-4.patch
      
      
      
    2. login: "a_kovalenko"
    3. mimetype: "text/plain"
    4. username: "a_kovalenko"
  16. Ticket change [f6bc02d7d3] (rid 130346) by patthoyts on 2005-11-03 18:58:17:

    1. status changed to: "Closed"
  17. Ticket change [a13d04fc06] (rid 109682) by patthoyts on 2005-11-03 18:58:18:

    1. closedate changed to: "2005-11-03T11:58:18"
    2. closer changed to: "patthoyts"
    3. icomment:
      Logged In: YES 
      user_id=202636
      
      Oh - well I just committed a backport already :) Thank you
      anyway.
      
      
      
    4. login: "patthoyts"
    5. mimetype: "text/plain"
    6. username: "patthoyts"
  18. Ticket change [1c04f61b14] (rid 90532) by hobbs on 2006-01-25 00:22:05:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Reopening - this caused Expect for Windows to break.  We
      need to revisit whether this is a core issue that may effect
      other extensions, or whether Expect for Windows must adapt.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "hobbs"
  19. Ticket change [2cb2154a17] (rid 118950) by hobbs on 2006-03-01 04:59:22:

    1. closedate changed to: "2006-02-28T21:59:22"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      This was addressed in Expect, updated to track channel
      encodings.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "hobbs"
  20. Ticket change [06d796e47e] (rid 89281) by hobbs on 2006-03-29 04:01:56:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      This is being reopened because it was not a complete
      implementation after all.  You will see the problem by
      running tclsh in XP and doing 'fconfigure stdin -encoding
      utf-8'.  This should output correctly (it used to), but
      hangs with this patch.
      
      I have reverted for 8.4.13, but it should be reverted or
      corrected for 8.5.  I left in the read|writeConsoleProc bits
      in case a corrected solution is presented that handles the
      internal channel encoding changes.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. resolution changed to: "Rejected"
    5. status changed to: "Open"
    6. username: "hobbs"
  21. Ticket change [ef1214f603] (rid 108929) by hobbs on 2006-03-29 05:40:49:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      See also comments in bug 1442305.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  22. Ticket change [e875ed32f6] (rid 104646) by a_kovalenko on 2010-03-01 07:06:28:

    1. icomment:
      As this artifact is still open, let me defend this implementation. My purpose is to ensure that it won't be rolled back for 8.6 as well.
      
      First, [fconfigure stdin -encoding utf8] didn't work before this patch, it just pretended to: utf-8 and a typical console codepage (whatever it be) have ASCII subset in common. Both with this patch and without it, the console channel after [fconfigure ... utf-8] is misconfigured, i.e. it cannot be used to input non-ascii characters correctly. The only difference is the amount of trouble caused by this misconfiguration.
      
      Mr. Hobbs seems to expect a solution that notices the upper-level -encoding reconfiguration on console channel and somehow takes it into account when the low-level I/O is done. If it's indeed the expected property of a "complete implementation", I would present an objection: no channel type ever worked this way, be it console channels or any other channels. The channel at the lowest level is a stream of bytes, and encoding translation is layered on top of it, but it doesn't affect the channel I/O behavior, ever. This principle was respected by Tcl from the very start of its unicode subsystem; it's also what extension and application developers do expect and will always expect.
      
      However, there is sometimes a reason for the channel type to influence _initial_ settings of the upper-level translation procedures: for example, TCP sockets require CR-LF line endings for most standard text-based network protocols. The same thing is true for the "unpatched" console channels: they preset the encoding to an autodetected codepage (result of GetConsoleCP); but they don't try to synchronize further channel encoding changes with console codepage. Once the channel is created, the application is free to fconfigure it to any encoding (breaking the correctness of translation, of course); if the console codepage is changed after the channel creation (exec cmd /c chcp...), the "real" low-level encoding and the tcl translation-level encoding are again out of sync.
      
      "Patched" implementation just detects and uses "unicode" as initial setting, exactly the same way as both implementations act on non-unicode systems, detecting non-unicode codepages. It doesn't prevent an application from altering it, even if it makes the channel unusable.
      
      To be short, I could say that [fconfigure stdin -encoding unicode] will hang the "unpatched" implementation and work with "patched" one: just the same as the reverse is true for -encoding utf-8 (which fact was the reason of rolling back this patch).
      
      There is, however, one possible compromise that may be added to my implementation to restore the backward compatibility, making the channel not-so-obviously-broken after encoding misconfiguration: I can use utf-8 as the "presented low-level" encoding on unicode systems, and do the utf8<->unicode translation during the I/O. This way, utf-8 will be set up as a channel encoding by default; if any application reconfigures the channel to utf-8 again, everything will work (not just pretend to); and if the channel is reconfigured to some wrong encoding being a superset of ASCII, the thing at least won't _hang_.
      
      Hereby I request comments from Mr. Hobbs, both of the current state of the patch and on the proposed improvement, on the possibility of backporting it again into 8.5 and 8.4 once the improvement is made, and on the plans for 8.6 (is it acceptable as is, or is it not rolled back only by accident? will it be acceptable if the change described above is made?).
      
      
    2. login: "a_kovalenko"
    3. mimetype: "text/plain"
    4. username: "a_kovalenko"
  23. Ticket change [3d08a810bc] (rid 121020) by hobbs on 2010-08-05 05:00:02:

    1. icomment:
      Is there a newer patch against the current 8.5 or head sources to reenable this?  Currently things are working ok for me, so I'd also like to know how to better test this, and why my utf-8 expectations are incorrect for that.
      
      Note that we only need to worry about NT+ systems in 8.6, if that makes like easier.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  24. Ticket change [9f320d21c5] (rid 96594) by a_kovalenko on 2010-08-05 08:47:20:

    1. icomment:
      It turned out that this _is_ still enabled both in 8.5 and 8.6 heads, and in 8.5.8 release, too (as I've migrated to 8.6 a while ago and didn't monitor 8.5, I was sure that it was removed from 8.5 and left enabled on 8.6 only). Somehow it got rejected but not rolled back (or rolled back on 8.4 only, as I suppose). Now we may at least be sure that it doesn't cause a lot of trouble, as it was there for 4+ years. After all those years, keeping it would be _maintaining_ compatibility, not _breaking_ it :)
      
      Unicode console works, unless you try to fconfigure it to some other encoding than "unicode". The situation differs from old, non-unicode I/O in one respect only: "ANSI" codepages are ASCII-compatible, while UCS-2 is not, so after incorrect fconfigure the old code continues to "work" with ASCII subset, which is enough to enter another fconfigure command, for example; but UCS-2 (called "unicode" in TCL) is so different from ASCII and most other codepages, that tclsh seems to be hanged after incorrect fconfigure.
      
      
      
    2. login: "a_kovalenko"
    3. mimetype: "text/plain"
    4. username: "a_kovalenko"
  25. Ticket change [c97d2cc1a7] (rid 122293) by hobbs on 2010-08-06 05:07:23:

    1. closedate changed to: "2010-08-05T22:07:23"
    2. closer changed to: "hobbs"
    3. icomment:
      
      
      allow_comments - 1
      
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Out of Date"
    7. status changed to: "Closed"
    8. username: "hobbs"