Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 3ecf8689e1124ef8ee8eb9d68f3ab4022be71558a6aab1488bb2bc7b54bb3a0c
Ticket: d19fe0a5bf54c97217eaba4b28a2c80cf4d16c13
Handling incomplete byte sequences for utf-16/utf-32
User & Date: jan.nijtmans on 2023-02-21 08:36:45
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    Example:
    
    <pre>
    % encoding convertfrom utf-16le \x41\x00\x41
    A
    </pre>
    
    In Tcl 8.7, we see what's happening when using -strict
    <pre>
    % encoding convertfrom -strict utf-16le \x41\x00\x00
    unexpected byte sequence starting at index 2: '\x0'
    </pre>
    
    But in Tcl 8.6 we don't have -strict, and the byte is silently ignored. That's not good.
    
    Many encodings either output the remaining bytes as-is or the replacement character \xFFFD. For UTF-16/32 outputting the remaining bytes (which easily could be \x00) doesn't make much sense. So most logical would be to output the replacement character in this case (just one).
    
  5. foundin changed to: "8.6"
  6. is_private changed to: "0"
  7. login: "jan.nijtmans"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "0c50e5320704d174412e57b873d8932de15303e0"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "jan.nijtmans"
  14. subsystem changed to: "- New Builtin Commands"
  15. title changed to:
    Handling incomplete byte sequences for utf-16/utf-32
    
  16. type changed to: "Bug"