Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5c20ad5d86602e092b740974908e014c18f5a6f3
Ticket: 473946ffffffffffffffffffffffffffffffffff
special characters not correctly sent
User & Date: nijtmans on 2012-05-10 05:02:02
Changes

  1. icomment:
    > Key questions to my thinking: When communicating with other Tcl processes,
    > should we transfer as Unicode, UTF-8 or [encoding system]? What about when
    > communicating with other processes?
    OK, let's sort that out.
    
    Currently, Tcl always comminucates in dde using the CF_TEXT clipboard
    format, which is meant for [encoding system]. But Tcl sends UTF-8
    over this. That's OK, when Tcl is at both ends. Most other applications
    (e.g. Word) communicate in CF_UNICODETEXT, which assumes Unicode.
    When both dde ends use a different clipboard format, Windows
    translates it automatically, and that's where the problem arises:
    This translation assumes the [system encoding], but in reality
    it's UTF-8.
    
    Bug #473946 is solved (in the branch) by letting Tcl do
    the translation. Tcl now understands both CF_TEXT and
    CF_UNICODETEXT, and when it receives a request
    for CF_UNICODETEXT it will send the answer in
    the requested format directly. This fixes the situation
    that Tcl handles de dde server size while any other
    application handles the client side.
    
    So, what to do when Tcl is the dde client.
    communicating with another dde server?
    Then Tcl should communicate in
    CF_UNICODETEXT then. But how
    can Tcl know whether the other size
    is Tcl or not? I think that starting with
    Tcl 8.6, All dde communications should
    be in CF_UNICODETEXT, unless
    an external client (e.g. Tcl 8.5) request
    differently. Then Tcl doesn't have
    to know what's on the other side, and
    doesn't need to provide an encoding.
    If an external client requests CF_TEXT,
    then Tcl can safely assume that
    it's communication with an older Tcl
    dde server, because no-one else
    still does that ;-).
    
    This way, TIP #106 is simply
    not necessary any more....
    
    
  2. login: "nijtmans"
  3. mimetype: "text/plain"
  4. username: "nijtmans"