Skip to content
Tcl Source Code History Of Ticket 9bad909c6ed4691b
Login

History Of Ticket 9bad909c6ed4691b

Artifacts Associated With Ticket 9bad909c6ed4691b

  1. Ticket change [f0444edf20] (rid 194753) by apnadkarni on 2021-06-12 06:18:05:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Question for someone well versed in encodings - is the following not supposed to work?
      
      % set x "abc\u543e"
      abc吾
      % encoding convertfrom jis0208 [encoding convertto jis0208 $x]
      ???吾
      
      Or
      
      % string equal \u543e [encoding convertfrom jis0208 [encoding convertto jis0208 \u543e]]
      1 (as expected)
      
      % string equal a [encoding convertfrom jis0208 [encoding convertto jis0208 a]]
      0 (broken)
      
      % binary encode hex [encoding convertto jis0208 a]
      2129
      
      That does not seem correct. At least as per http://x0213.org/codetable/jisx0213-2004-8bit-std.txt
      
      
      
      
      Also tried with some older versions - 8.5.17 and 8.6.3 fail in similar fashion.
      
    5. foundin initialized to: "8.6.11"
    6. is_private initialized to: "0"
    7. login: "apnadkarni"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Important"
    11. status initialized to: "Open"
    12. submitter initialized to: "apnadkarni"
    13. subsystem initialized to: "11. Conversions from String"
    14. title initialized to: "jis0208 encoding fails for ASCII input"
    15. type initialized to: "Bug"
  2. Ticket change [6f50a3e461] (rid 194757) by apnadkarni on 2021-06-12 10:18:01:

    1. icomment:
      From the Tclers' chat:
      
      aspect:
      Even with preference for doubl width encoding convertto and convertfrom should match" ... well, necessarily not always
      
      if (what seems to be the current interpretation) only fullwidth Latin characters exist in the target set, then "a" can't round-trip
      2:38
      if the encoding interprets what's in that table to mean that both u+0061 and u+ff41 map to the same encoding, then only one of those can round-trip
      
      apn:
      @aspect, I wasn't even aware there was a full width a (thereby showing my ignorance in this area). So are you saying it is not a bug because no round tripping is possible?
      
      aspect:
      well it might be a bug - bit even if it is, some round trips will not be possible.  I don't know whether it's better for jis0209 to map ascii latin characters vs fullwidth versions, or if the version of [encoding convertto] that takes both to the same codepoints is a good idea
      
      pooryorick:
      apn, the bug is that [encoding convertfrom] converts one character to another character.
      
      pooryorick:
      aspect, why should [enocding convertfrom] convert a narrow "a" to a wide "a"?
      
      aspect:
      It doesn't
      [encoding convertfrom jis0208 [encoding convertto jis0208 a\uff41]] produces "\uff1f\uff41".  That matches the intermediate encoded bytes.  The change is when convertto doesn't know how to encode "a" so it subtitutes a fullwidth question mark
      
      So I do not know if this is a real bug or not. It was certainly surprising behavior to me. I'll leave open for someone knowledgeable to mark appropriately.
      
    2. login: "apnadkarni"
    3. mimetype: "text/plain"
  3. Ticket change [8ab12cb6a0] (rid 216249) by apnadkarni on 2023-07-05 10:15:12:

    1. closedate changed to: "2460130.92722405"
    2. closer changed to: "apnadkarni"
    3. icomment:
      Closing as not a bug. Agreed with @aspect's explanation now that I understand encodings better.
      
    4. login: "apnadkarni"
    5. mimetype: "text/plain"
    6. resolution changed to: "Invalid"
    7. status changed to: "Closed"