# Should not be run on Windows
NAME=utf8 (possibly malformed) filenames with non-printable chars
FILE==
CMDS=<<EOF
cd `e dir.tmp`
e io.cache=true
(show_fname fname; wz ${fname}; prz `$size` > `prz`; o `prz`; i~file; ij; rm `prz`)
$size=%l \`prz\`
.(show_fname A\x1b¢\302\200€𝄞\363\240\201\201\\.bin)
.(show_fname B\x1b¢\302\200€𝄞\363\240\201\201\\.bin)
# INVALID FILENAME .(show_fname B\x1b¢\302\200\201€𝄞\363\240\201\201\\.bin)
EOF
EXPECT=<<EOF
file    A\e¢\U00000080€𝄞\U000e0041\.bin
{"core":{"file":[65,27,194,162,194,128,226,130,172,240,157,132,158,243,160,129,129,92,46,98,105,110],"fd":4,"size":22,"humansz":"22","iorw":true,"mode":"r-x","block":256,"format":"any"}}
file    B\e¢\U00000080€𝄞\U000e0041\.bin
{"core":{"file":[66,27,194,162,194,128,226,130,172,240,157,132,158,243,160,129,129,92,46,98,105,110],"fd":5,"size":22,"humansz":"22","iorw":true,"mode":"r-x","block":256,"format":"any"}}
EOF
RUN
