Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ec7ece5e3706f151718ed7b6df4200ef53a637b8757e499b76a9c8836f484b71
Ticket: f2e924e88181d602cb3b558afba3dc2995ea11a6
Error reading fixed number of characters from UTF16-LE file containing non-BMP chars
User & Date: apnadkarni on 2024-08-20 05:37:13
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    The following writes emoji to a file in UTF16LE and reads the file back successfully. However, reads of a specific number of characters fails.
    
    ```
    % set fd [open utf16.txt wb]
    file26c91f9a4c0
    % puts -nonewline $fd [encoding convertto utf-16le A\U1F600]
    % close $fd
    % set fd [open utf16.txt]; fconfigure $fd -encoding utf-16le
    % read $fd
    A😀
    % close $fd
    % set fd [open utf16.txt]; fconfigure $fd -encoding utf-16le
    % read $fd 2
    error reading "file26c937c7370": invalid or incomplete multibyte or wide character
    % close $fd
    ```
    
    Note the full file read succeeds but the read of two chars fails.
    
    Marked as important because UTF-16LE is native to Win32 API.
    
  5. foundin changed to: "9.0b3"
  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: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "apnadkarni"
  14. subsystem changed to: "- New Builtin Commands"
  15. title changed to:
    Error reading fixed number of characters from UTF16-LE file containing non-BMP chars
    
  16. type changed to: "Bug"