Is it safe to use tar
even if there are some characters other than ASCII printable characters?
For example, Japanese characters, Chinese characters, newline character etc.
Are there any known problems that might make tarball extraction fail if using special characters?
tar
- which does not encode anything but sparse files - but a POSIXtar/pax
will encode files as UTF-8 or not at all and record its type as BINARY. And a POSIXtar/pax
does allow for changing a charset, anyway.tar
that's all - @Sys' answer covered the POSIX option. The OP has tagged this aslinux
and the CentOS 7 and Ubuntu 14.04 boxes I run both showtar --show-defaults
still as--format=gnu
, therefore there is a very good chance that the OP will be usingtar
in GNU mode by default. Thanks for mentioningpax
by the way - never really looked at it before :-) Time for some reading...pax
soon - the features listed here are really friggin cool - but I've yet to actually find apax
that supports them - or all of them - especially the-o listop=...
. The closest I've come, actually, is GNUtar
and modified headers with--format=posix --pax-option=...
- but still notlistop
... sigh. The POSIXpax
description is among the best - reading it was enough for me to do this.