bsdtar and locale

Gennady Proskurin gprspb at mail.ru
Wed Dec 8 21:03:39 UTC 2010


bsdtar (which is default "tar" in freebsd) treats file/directory names in
locale-dependent manner. For example, if you archive some file with utf-8 name
in "C" locale (env LC_ALL=C tar -c ...), and then extract it in some UTF-8
locale, it's name will be corrupted. Such a behaviour is somewhat documented in
archive_entry(3) and bsdtar(1) manpages, so this is not a bug, but feature.

I agree, such conversions can be usefull in some cases, but should be disabled
by default (we are unix, filenames are just binary data).
It is very annoying, it makes you to always think about locales while creating
and extracting archive.

For now, I use gtar for backups to avoid such a problems.



More information about the freebsd-arch mailing list