Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 823bd9c92820a6a04733fcf00355ec00519e08fe
Ticket: 79614fb8b61983ac8ef30ea8752c310465798fc7
[glob], [encoding system] and encoding-free filesystems
User & Date: pooryorick on 2016-11-07 23:03:09
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    in the following example, on a Linux system, where filesystems are
    encoding-free, the file is only opened when the Tcl system encoding is
    iso8859-1.  Furthermore, when the line
    
    <code><verbatim>set name $directory/[lindex $names 0]</verbatim></code>
    
    is moved out of the loop, the file is not successfully opened at all.
    
    <code><verbatim>
    set sysencoding_orig [encoding system]
    
    set name0 "funky \xa2 name"
    
    # Set up for the demonstration of the bug by creating a file whose name is
    # exactly the bytes in the string below
    close [open $name0 wb]
    
    set directory [pwd]
    set names [glob -directory $directory -tails *]
    foreach encoding [list $sysencoding_orig iso8859-1] {
    	encoding system $encoding 
    	set name $directory/[lindex $names 0]
    	puts [list {globbed name identical?} [expr {$name0 eq $name}]]
    	try {
    		set chan [open $name]
    		encoding system $sysencoding_orig
    		puts [list {opened with system encoding} $encoding]
    		close $chan
    	} on error {cres copts} {
    		puts [list {failed to open with system encoding} $encoding]
    	}
    }
    encoding system $sysencoding_orig
    </verbatim></code>
    
  5. foundin changed to: "8.6.7"
  6. is_private changed to: "0"
  7. login: "pooryorick"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Important"
  11. status changed to: "Open"
  12. submitter changed to: "pooryorick"
  13. subsystem changed to: "16. Commands A-H"
  14. title changed to:
    [glob], [encoding system] and encoding-free filesystems
    
  15. type changed to: "Bug"