Skip to content
Tcl Source Code History Of Ticket 3597180fff
Login

History Of Ticket 3597180fff

Artifacts Associated With Ticket 3597180fff

  1. Ticket change [1e6f3cd15b] (rid 90977) by wracsaftishy on 2012-12-18 11:50:34:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Currently, Tcl never throws an error when:
      
      1) Encountering an invalid byte sequence in the
         source encoding when performing an "encoding
         convertfrom" or while reading from a channel.
      
      2) Encountering a Unicode character that cannot
         be represented in the target encoding when
         performing an "encoding convertto" or while
         writing to a channel.
      
      For example, these commands succeed
      despite the data being incorrect:
      
      $ tclsh
      % encoding convertto iso8859-1 "\u4E24"
      ?
      % encoding convertfrom utf-8 "\xC3\x28"
      Ã(
      
      This behaviour is often convenient if one wants
      ones app to carry on "working" whatever happens,
      but it's less desirable if one wants security or
      correctness.
      
      I feel Tcl would benefit from allowing a user to
      request stricter encoding conversions.
      
      Perhaps one way to do this would be to add a -strict
      option to the encoding convert* commands:
      
      encoding convertfrom ?-strict? ?encoding? data
      encoding convertto ?-strict? ?encoding? string
      
      And add a "-strictEncoding boolean" option to
      fconfigure and chan configure.
      
      I guess there might be other Tcl commands that
      perform encoding conversions that might need to
      be considered ("source" is one that comes to mind).
      
      I'm not familiar enough with the C-level API to
      propose changes there.
      
      Alternatively, if this was targetted for Tcl 9 then
      strictness could be made the default ...
      
      
    4. foundin initialized to: "None"
    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: "wracsaftishy"
    10. subsystem initialized to: "None"
    11. title initialized to:
      Ability to perform stricter encoding conversion checks
      
    12. type initialized to: "RFE"
  2. Ticket change [a4ea56b431] (rid 148404) by dkf on 2016-08-20 17:08:36:

    1. assignee changed to: "dgp"
    2. closer changed to: "nobody"
    3. comment changed to:
      Currently, Tcl never throws an error when:
      
      1) Encountering an invalid byte sequence in the
         source encoding when performing an "encoding
         convertfrom" or while reading from a channel.
      
      2) Encountering a Unicode character that cannot
         be represented in the target encoding when
         performing an "encoding convertto" or while
         writing to a channel.
      
      For example, these commands succeed
      despite the data being incorrect:
      
      $ tclsh
      % encoding convertto iso8859-1 "\u4E24"
      ?
      % encoding convertfrom utf-8 "\xC3\x28"
      Ã(
      
      This behaviour is often convenient if one wants
      ones app to carry on "working" whatever happens,
      but it's less desirable if one wants security or
      correctness.
      
      I feel Tcl would benefit from allowing a user to
      request stricter encoding conversions.
      
      Perhaps one way to do this would be to add a -strict
      option to the encoding convert* commands:
      
      encoding convertfrom ?-strict? ?encoding? data
      encoding convertto ?-strict? ?encoding? string
      
      And add a "-strictEncoding boolean" option to
      fconfigure and chan configure.
      
      I guess there might be other Tcl commands that
      perform encoding conversions that might need to
      be considered ("source" is one that comes to mind).
      
      I'm not familiar enough with the C-level API to
      propose changes there.
      
      Alternatively, if this was targetted for Tcl 9 then
      strictness could be made the default ...
      
    4. login: "dkf"
    5. mimetype: "text/plain"
    6. priority changed to: "7 High"
    7. severity changed to: "Minor"
    8. subsystem changed to: "11. Conversions From String"
  3. Ticket change [2e44fab70f] (rid 148443) by dkf on 2016-08-23 13:46:39:

    1. login: "dkf"
    2. mimetype: "text/plain"
    3. subsystem changed to: "11. Conversions from String"
  4. Ticket change [c921fb0179] (rid 261536) by serhiy.storchaka on 2026-11-13 11:18:44:

    1. closedate changed to: "2461357.9713335303"
    2. closer changed to: "serhiy.storchaka"
    3. icomment:
      Tcl 9.0 has encoding profiles (TIP 656): encoding convertfrom/convertto -profile strict, chan configure -profile and source -encoding raise errors on invalid data, and strict is the default (TIP 657).
      
    4. login: "serhiy.storchaka"
    5. mimetype: "text/x-fossil-wiki"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"