3 # Copyright (c) 2019 Poor Yorick
5 if {[string equal $::tcl_platform(os) "Windows NT"]} {
9 namespace eval ::tcl::test::fileSystemEncoding {
11 if {"::tcltest" ni [namespace children]} {
12 package require tcltest 2.5
13 namespace import -force ::tcltest::*
16 variable fname1 \u767b\u9e1b\u9d72\u6a13
20 set scriptpath [info script]
21 set scriptpathnorm [file dirname [file normalize $scriptpath/...]]
22 set dirnorm [file dirname $scriptpathnorm]
23 set idx [lsearch -exact $auto_path $dirnorm]
25 set auto_path [lreplace $auto_path[set auto_path {}] $idx $idx {}]
27 set auto_path [linsert $auto_path[set auto_path {}] 0 0 $dirnorm]
31 package require tcltests
33 test filesystemEncoding-1.0 {
36 set dir [tcltests::tempdir]
37 set saved [encoding system]
38 encoding system iso8859-1
39 set fname1a $dir/$fname1
40 set utf8name [encoding convertto utf-8 $fname1a]
42 set globbed [lindex [glob -directory $dir *] 0]
44 set res [file exists $globbed]
45 encoding system iso8859-1
46 lappend res [file exists $globbed]
50 file delete -force $dir
51 encoding system $saved