| 1 |
#! /usr/bin/env tclsh |
| 2 |
|
| 3 |
# Copyright (c) 2019 Poor Yorick |
| 4 |
|
| 5 |
if {[string equal $::tcl_platform(os) "Windows NT"]} { |
| 6 |
return |
| 7 |
} |
| 8 |
|
| 9 |
namespace eval ::tcl::test::fileSystemEncoding { |
| 10 |
|
| 11 |
if {"::tcltest" ni [namespace children]} { |
| 12 |
package require tcltest 2.5 |
| 13 |
namespace import -force ::tcltest::* |
| 14 |
} |
| 15 |
|
| 16 |
variable fname1 \u767b\u9e1b\u9d72\u6a13 |
| 17 |
|
| 18 |
source [file join [file dirname [info script]] tcltests.tcl] |
| 19 |
|
| 20 |
test filesystemEncoding-1.0 { |
| 21 |
issue bcd100410465 |
| 22 |
} -body { |
| 23 |
set dir [tcltests::tempdir] |
| 24 |
set saved [encoding system] |
| 25 |
encoding system iso8859-1 |
| 26 |
set fname1a $dir/$fname1 |
| 27 |
set utf8name [encoding convertto utf-8 $fname1a] |
| 28 |
makeFile {} $utf8name |
| 29 |
set globbed [lindex [glob -directory $dir *] 0] |
| 30 |
encoding system utf-8 |
| 31 |
set res [file exists $globbed] |
| 32 |
encoding system iso8859-1 |
| 33 |
lappend res [file exists $globbed] |
| 34 |
return $res |
| 35 |
} -cleanup { |
| 36 |
removeFile $utf8name |
| 37 |
file delete -force $dir |
| 38 |
encoding system $saved |
| 39 |
} -result {0 1} |
| 40 |
|
| 41 |
cleanupTests |
| 42 |
} |