summaryrefslogtreecommitdiffstats
path: root/tests/fileSystemEncoding.test
blob: f47635d61c9d434f22875343c1d35ac7b2125758 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!  /usr/bin/env tclsh

# Copyright © 2019 Poor Yorick

if {[string equal $::tcl_platform(os) "Windows NT"]} {
    return
}

namespace eval ::tcl::test::fileSystemEncoding {

    if {"::tcltest" ni [namespace children]} {
	package require tcltest 2.5
	namespace import -force ::tcltest::*
    }

    variable fname1 登鸛鵲樓

    source [file join [file dirname [info script]] tcltests.tcl]

    test filesystemEncoding-1.0 {
	issue bcd100410465
    } -body {
	set dir [tcltests::tempdir]
	set saved [encoding system]
	encoding system iso8859-1
	set fname1a $dir/$fname1
	set utf8name [encoding convertto utf-8 $fname1a]
	makeFile {} $utf8name
	set globbed [lindex [glob -directory $dir *] 0]
	encoding system utf-8
	set res [file exists $globbed]
	encoding system iso8859-1
	lappend res [file exists $globbed]
	return $res
    } -cleanup {
	removeFile $utf8name
	file delete -force $dir
	encoding system $saved
    } -result  {0 1}

    cleanupTests
}