Incorrect handling UTF-8 symbol 'с' (U+0441) in redirection operator
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
In mc (midnight commander) i've found that i can't open archives in folder named 'Рабочий стол' (this means 'Desktop' in russian). After some researching i've found that problem in /bin/sh (dash) - it can't redirect input or output from files that contains russian letter 'с'.
Steps to reproduce:
$ /bin/dash
$ echo 'с' | hexdump
0000000 81d1 000a
0000003
$ mkdir /tmp/с
$ touch /tmp/с/a.txt
$ echo ok > /tmp/с/a.txt
/bin/dash: cannot create /tmp/�/a.txt: Directory nonexistent
$ tail < /tmp/с/a.txt
/bin/dash: cannot open /tmp/�/a.txt: No such file
Expected result (example of bash session):
$ echo 'с' | hexdump
0000000 81d1 000a
0000003
$ mkdir /tmp/с
$ touch /tmp/с/a.txt
$ echo ok > /tmp/с/a.txt
$ tail < /tmp/с/a.txt
ok
Same problem here, but with character "∕", which is not the normal slash (directory separator), but U+2215. That's 0xe2 0x88 0x95 but dash treats it as 0xe2 0x95!
I discovered it trying to create a file and the problem was the same.