0

Say I want to create a backup of folder MainFolder's content using rar. The command

rar a Backup.rar -r MainFolder

does the job.

BUT, if a subdirectory contains more than one file named with non-ASCII (?) characters, then only one of them is archived and the others get excluded.

For example, consider the following directory hierarchy (MainFolder, A and B are folders; a, b, and are files)

+MainFolder
   +A
      -a
      -b
      -你
      -好
   +B
      -a
      -b
   -a
   -b
   -你
   -好

then the command rar a Backup.rar -r MainFolder skips

MainFolder/A/好
MainFolder/好

while rar a Backup.rar -r MainFolder/* still skips

MainFolder/A/好

Why is it so? Any help is greatly appreciated, thanks!

For the record, I already encountered some issues with non-ascii characters (see this question) that other Linux distributions seem not to have. Anyway, I use Lubuntu 12.04, terminal is lxterminal and echo $BASH_VERSION returns 4.2.25(1)-release. rar version is 4.00 beta 3.

Another curiosity: right-clicking on the folder and selecting Compress... and then .rar still has the same problem. Other options (zip, tar...) behave correctly.

AndreasT
  • 341
  • 3
  • 11
  • I use RAR 4.20 and I don't have this problem. Maybe there is more than only `好` character in the name of that directory. – Radu Rădeanu Nov 13 '13 at 07:16
  • @RaduRădeanu Thanks for trying it out. What do you mean by 'there is more than only `好` character in the name of that directory'? The directory I tested is exactly as that shown above. – AndreasT Nov 13 '13 at 08:54
  • To check if doesn't contain any others white/special characters, what is the output of `ls -ld 好` and `ls -ld A/好` commands when you are inside `MainFolder`? – Radu Rădeanu Nov 13 '13 at 08:59
  • They return just `-rw-rw-r-- 1 radyce radyce 0 Nov 12 23:20 好` [resp. `A/好`]. – AndreasT Nov 13 '13 at 09:04
  • This mean that doesn't contain any others characters. Check your rar version; as I told you, I use RAR 4.20 and I don't have this problem. – Radu Rădeanu Nov 13 '13 at 09:08
  • Another strange issue is that running `find Main` in `Main`'s parent folder displays everything correctly, but `rar a Backup.rar $(find Main)` still skips every non-ascii filename from the second on in each folder. Really odd isn't it? – AndreasT Nov 13 '13 at 09:15

1 Answers1

1

I think that your command will just work with UTF-8 enabled in the shell, so all you need to do is enable that. To do this run first the following command:

export LANG=en_US.UTF-8

To make the change permanently, add the above line in your ~/.bashrc file.

Radu Rădeanu
  • 166,822
  • 48
  • 327
  • 400
  • `LANG` was set to `en_GB.UTF-8`, switching to US didn't solve the problem :( – AndreasT Nov 13 '13 at 09:30
  • @AndreasT Maybe you are experiencing [this bug](https://bugzilla.gnome.org/show_bug.cgi?id=108711). See also: http://unix.stackexchange.com/questions/8859/can-a-gnome-terminal-profile-use-utf-8-by-default. – Radu Rădeanu Nov 13 '13 at 09:38
  • @AndreasT And again, update to the last version of rar, which now is 4.20. – Radu Rădeanu Nov 13 '13 at 09:43