Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3df76c59f4c8c2336151450f183bb731e5eef222
Ticket: 1442305fffffffffffffffffffffffffffffffff
fconfigure stdout -encoding error
User & Date: davygrvy on 2006-03-04 10:36:28
Changes

  1. icomment:
    Logged In: YES 
    user_id=7549
    
    <tclguy@Jabber> we can keep the W perhaps, but we need a
    conversion to desired encoding, no?
    
    The problem as I see it is that we don't really know what
    this buffer is that comes into the Tcl_DriverOutputProc.  We
    could do an upconversion to unicode in the TDOP, but we'd
    take a performance hit asking what our channels encoding is,
    then perform the upcast.
    
    This is what I don't understand..  Why do we (as a channel
    driver) not tell the generic ourselves what we are?  I mean,
    we know what the console's codepage is and how to change it
    (G|S)etConsoleCP.
    
    <pipedream>
    What if an optional new entry into the driver structure for
    version 5 existed so the generic layer can hook into us so
    we can apply rules for encodings?  That'd be sweet..
    
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/unicode_81rn.asp
    
    Oh, you want EBCDIC?  SetConsoleCP(37); failed, so I'll
    return TCL_ERROR so [fconfigure] barfs back.
    
    Oh.. you want unicode, set flag so our TDOP will use
    WriteConsoleW, return TCL_OK to allow [fconfigure] to change
    the generic side.
    </pipedream>
    
    Would that work?  How much code change is that?
    
    
  2. login: "davygrvy"
  3. mimetype: "text/plain"
  4. username: "davygrvy"