Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4736f5b7dba7ec9598e91b22460c12b6a5577ade381d433ff218936d6a092fd2
Ticket: 80d4c1c7e5393907df677e56ccc41bb78ffafe19
Isolated surrogates are not replaced when encoding to / from utf-8
User & Date: apnadkarni on 2024-02-06 11:38:47
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    Isolated (unpaired) surrogates should be treated as encoding errors.
    
    Example:
    
    ```
    % binary encode hex [encoding convertto  -profile strict utf-8 \UD800]
    unexpected character at index 0: 'U+00D800'
    ```
    
    The above is correct as U+D800 should not appear as an isolated surrogate code point. However the following is not,
    
    ```
    % binary encode hex [encoding convertto  -profile replace utf-8 \UD800]
    eda080
    ```
    
    eda080 is the utf-8 for U+D800. The output have been efbfbd (U+FFFD replacement char).
    
    In principle, any time the strict profile raises an error, the replace profile should be substituting the replacement character.
    
    Jan, your thoughts?
    
  5. foundin changed to: "9.0"
  6. is_private changed to: "0"
  7. login: "apnadkarni"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "9546e9877f1a8899e25a89082561ee694e7fb402"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "apnadkarni"
  14. subsystem changed to: "44. UTF-8 Strings"
  15. title changed to:
    Isolated surrogates are not replaced when encoding to / from utf-8
    
  16. type changed to: "Bug"