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

History Of Ticket 3063568fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 3063568fffffffffffffffffffffffffffffffff

  1. Ticket change [188d6b6d88] (rid 122681) by jaspertheperson on 2010-09-10 11:57:18:

    1. assignee initialized to: "pvgoran"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      It's this one:
      ===========================================
      Convert all non-ASCII and Tcl-significant characters into \u escape sequences by using regsub and subst in combination:
      
      # This RE is just a character class for everything "bad"
      set RE {[][{};#\\\$\s\u0080-\uffff]}
      
      # We will substitute with a fragment of Tcl script in brackets
      set substitution {[format \\\\u%04x [scan "\\&" %c]]}
      
      # Now we apply the substitution to get a subst-string that
      # will perform the computational parts of the conversion.
      set quoted [subst [regsub -all $RE $string $substitution]]
      
      ===========================================
      The RE for "bad" characters includes \s which matches all whitespace characters including newline. However, inserting \ before newline before calling subst on a string containing it does not preserve the newline, it causes it to be replaced by a space, so the whole procedure replaces newlines with \u0020
      
      Not sure how to get this to work properly! Little help?
      
    4. foundin initialized to: "obsolete: 8.6b1"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "jaspertheperson"
    10. subsystem initialized to: "43. Regexp"
    11. title initialized to: "regsub example doesn't perform as advertized"
    12. type initialized to: "Bug"
  2. Ticket change [bed1725dc3] (rid 102150) by dkf on 2010-09-10 19:43:52:

    1. assignee changed to: "dkf"
    2. icomment:
      Good catch. Newlines need to be handled specially. :-(
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  3. Ticket change [a3f46d26f5] (rid 110130) by dkf on 2010-09-10 19:55:19:

    1. icomment:
      Updated example text is as below.
      
                    # This RE is just a character class for almost everything "bad"
                    set RE {[][{};#\\\$ \r\t\u0080‐\uffff]}
      
                    # We will substitute with a fragment of Tcl script in brackets
                    set substitution {[format \\\\u%04x [scan "\\&" %c]]}
      
                    # Now we apply the substitution to get a subst‐string that
                    # will perform the computational parts of the conversion. Note
                    # that newline is handled specially through string map since
                    # backslash‐newline is a special sequence.
                    set quoted [subst [string map {\n {\\u000a}} \
                            [regsub -all $RE $string $substitution]]]
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  4. Ticket change [99a97110b2] (rid 110830) by dkf on 2010-09-10 20:02:46:

    1. icomment:
      Fixed in HEAD and 8.5 branch (alas, just missed the train for 8.5.9...)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  5. Ticket change [3555349688] (rid 106905) by dkf on 2010-09-10 20:03:02:

    1. icomment:
      
      
      allow_comments - 1
      
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
    6. username: "dkf"
  6. Ticket change [25c39e8aea] (rid 88224) by dkf on 2010-09-10 20:03:03:

    1. closedate changed to: "2010-09-10T13:03:03"
    2. closer changed to: "dkf"