# tar: Can't translate pathname



## erikf154 (May 24, 2012)

Getting this weird message from tar, can't find any info about it on google. I'm using tar to back up a custom DB. Even though the system is set to UTF8 tar doesn't seem to like the question mark as a directory name.

```
# ll
total 3
drwxr-xr-x  3 www  www  3 Nov 25 15:08 E
drwxr-xr-x  3 www  www  3 Nov 25 15:08 ?
# tar czf test.tgz *
tar: Ö¯: Can't translate pathname 'Ö¯' to UTF-8
tar: Ö¯R/: Can't translate pathname 'Ö¯R/' to UTF-8
tar: Ö¯R/__46__/: Can't translate pathname 'Ö¯R/__46__/' to UTF-8
tar: Ö¯R/__46__/0/: Can't translate pathname 'Ö¯R/__46__/0/' to UTF-8
tar: Ö¯R/__46__/2/: Can't translate pathname 'Ö¯R/__46__/2/' to UTF-8
tar: Ö¯R/__46__/1/: Can't translate pathname 'Ö¯R/__46__/1/' to UTF-8
# locale
LANG=
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8
```

Any help is appreciated


----------



## fluca1978 (May 24, 2012)

This is just a guess, but seems to me tar is not able to process some strange name in your folders, and maybe is not able to print it out too, so you are not seeing where the problem is. The first thing I see is that you have a _?_ folder, that is not really good. I would try to do a simple loop against each folder/file to see which particular path is causing the problem.


----------



## erikf154 (May 29, 2012)

Got it working by setting LC_ALL to UTF-16.


----------



## Oclair (Jun 30, 2019)

erikf154 said:


> Got it working by setting LC_ALL to UTF-16.



How do I set LC_ALL to UTF-16?


----------

