Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Globbing autocorrects misencoded filenames?



Hello,

While writing a script that deals with files named using an incorrect
encoding (eg. latin1 on a utf8 system), I came across a strange zsh
feature:

  [waba@waba]~ % zsh -f
  waba% locale
  LANG=POSIX
  LC_CTYPE=fr_BE.utf8
  LC_NUMERIC=POSIX
  LC_TIME=POSIX
  LC_COLLATE=fr_BE.utf8
  LC_MESSAGES=POSIX
  LC_ALL=
  waba% touch $( echo /tmp/Ãbc |iconv -tlatin1 )
  waba% echo /tmp/Ãb?
  /tmp/ïbc

IOW, I create a file named "Ãbc" (a-grave b c) using latin1 encoding on
my utf8 system, but it still matches as utf8 during globbing.

Expected behavior: the first character of that filename is not valid
utf8 and should not match anything except itself. I expected the shell
to return "zsh: no matches found: /tmp/Ãb?".

So,
1) Is there a list of the encodings tried by ZSH ? latin1/iso-8859-1 is
   not mentioned anywhere in my configuration...
2) Can this feature be disabled at all ? I'm sure that it can be useful
   at the prompt, but it's a nuisance inside my script.

TIA,
-Thomas.

Attachment: signature.asc
Description: Digital signature



Messages sorted by: Reverse Date, Date, Thread, Author