Page 1 of 2

unrar: filename with German special characters

Posted: 10 Feb 2017, 17:38
by rolmei
Hallo.
i know this is the nzbget forum and not the unrar forum, but perhaps somebody know the answer:

I have nzb file with german special characters in the filename (look attachment). Now unrar can not extract.

Some ideas?

THX
Roland

Re: unrar: filename with German special characters

Posted: 10 Feb 2017, 18:33
by hugbug
No attachment.
Please also post the full log of nzb-file download (history -> click on item -> button log -> save to file.
What is your OS, nzbget version, hardware?

Re: unrar: filename with German special characters

Posted: 11 Feb 2017, 14:25
by rolmei
THX
Here are twio examples.
The nzb file with extension jpg, otherwise no upload

Re: unrar: filename with German special characters

Posted: 11 Mar 2017, 22:20
by rolmei
No ideas

Re: unrar: filename with German special characters

Posted: 11 Aug 2019, 13:34
by rolmei
Where is the log of unrar?

Re: unrar: filename with German special characters

Posted: 11 Aug 2019, 14:52
by sanderj
Hi rolmei,

First of all; on what OS does your nzbget run?

On Linux, I can confirm what you describe. The cause is the resulting pdf file contains a Unicode character in the filename: c3 a4, which is Unicode U+00E4 aka ä

Probable cause: the ENV variable LANG (for "language") that is 'actual' when nzbget calls unrar:
* when env var LANG set to en_US.UTF-8 unrar works OK.
* when env var LANG set to C, the filename is cut off
See below.

Solution / workaround:
I tried "env LANG=en_US.UTF-8 ./nzbget -s", but that didn't work
I tried setting UnrarCMD to "env LANG=en_US.UTF-8 ${AppDir}/unrar", but that didn't work either.

So I think the help of hugbug is needed: I think nzbget should set "LANG=en_US.UTF-8" with calling unrar.
With these C++ snippets I'm able to reproduce & correct the problem:

Code: Select all

	system("env LANG=C unrar x -y  *part01.rar");
	system("env LANG=en_US.UTF-8 unrar x -y  *part01.rar");
Until then: do a manual unrar like below.


Good:

Code: Select all

$ env LANG=en_US.UTF-8 unrar x -y  *part01.rar

UNRAR 5.71 freeware      Copyright (c) 1993-2019 Alexander Roshal


Extracting from Brigitte Woman - Maerz 2017.part01.rar

Extracting  Brigitte Woman - März 2017.pdf                            14%

Extracting from Brigitte Woman - Maerz 2017.part02.rar

...         Brigitte Woman - März 2017.pdf                            28%

Extracting from Brigitte Woman - Maerz 2017.part03.rar

...         Brigitte Woman - März 2017.pdf                            42%

Extracting from Brigitte Woman - Maerz 2017.part04.rar

...         Brigitte Woman - März 2017.pdf                            56%

Extracting from Brigitte Woman - Maerz 2017.part05.rar

...         Brigitte Woman - März 2017.pdf                            71%

Extracting from Brigitte Woman - Maerz 2017.part06.rar

...         Brigitte Woman - März 2017.pdf                            85%

Extracting from Brigitte Woman - Maerz 2017.part07.rar

...         Brigitte Woman - März 2017.pdf                            99%

Extracting from Brigitte Woman - Maerz 2017.part08.rar

...         Brigitte Woman - März 2017.pdf                            OK 
All OK
Not good:

Code: Select all

$ env LANG=C unrar x -y  *part01.rar

UNRAR 5.71 freeware      Copyright (c) 1993-2019 Alexander Roshal


Extracting from Brigitte Woman - Maerz 2017.part01.rar

Extracting  Brigitte Woman - M?rz 2017.pdf                            14%

Extracting from Brigitte Woman - Maerz 2017.part02.rar

...         Brigitte Woman - M?rz 2017.pdf                            28%

Extracting from Brigitte Woman - Maerz 2017.part03.rar

...         Brigitte Woman - M?rz 2017.pdf                            42%

Extracting from Brigitte Woman - Maerz 2017.part04.rar

...         Brigitte Woman - M?rz 2017.pdf                            56%

Extracting from Brigitte Woman - Maerz 2017.part05.rar

...         Brigitte Woman - M?rz 2017.pdf                            71%

Extracting from Brigitte Woman - Maerz 2017.part06.rar

...         Brigitte Woman - M?rz 2017.pdf                            85%

Extracting from Brigitte Woman - Maerz 2017.part07.rar

...         Brigitte Woman - M?rz 2017.pdf                            99%

Extracting from Brigitte Woman - Maerz 2017.part08.rar

...         Brigitte Woman - M?rz 2017.pdf                            OK 
All OK

Re: unrar: filename with German special characters

Posted: 11 Aug 2019, 19:16
by hugbug
What about

Code: Select all

export LANG=en_US.UTF-8
./nzbget -s
?

Otherwise a stub-script to launch unrar can be used. Create script unrar.sh and set it into option UnrarCmd. An example script:

Code: Select all

#!/bin/sh 

DIR=`pwd`
echo "current dir: $DIR"
echo "unrar start command: unrar $@"

# here calling unrar
unrar "$@"
UNRAR_EXIT_CODE=$?
echo "unrar exit code: $UNRAR_EXIT_CODE";

# return exit code captured from unrar
exit $UNRAR_EXIT_CODE
This is just example, please add necessary commands to set LANG before executing unrar.

Re: unrar: filename with German special characters

Posted: 04 Oct 2019, 19:41
by al3x
I had the same problem recently with this release:
Stumptown.S01E01.1080p.AMZN.WEB-DL.DDP5.1.H.264-NTb

Unrar didn't work because of a ’ instead of ' in filename.

The unrar.sh workaround did the trick here. Content of unrar.sh:

Code: Select all

#!/bin/sh
export LANG=en_US.UTF-8
unrar "$@"
exit $?
UnrarCMD parameter:

Code: Select all

${AppDir}/unrar.sh x -ai
Thanks for the ideas ;)

Re: unrar: filename with German special characters

Posted: 06 Oct 2019, 08:01
by sanderj
I've created a nice reference NZB:

https://raw.githubusercontent.com/sande ... c1c39c.nzb

It will result in the filename Heizölrückstoßabdämpfung.bin ... :D

Re: unrar: filename with German special characters

Posted: 06 Oct 2019, 12:34
by al3x
Ok, I did some more testing and I think it's more complicated than I thought unfortunately.

That "unrar.sh" trick didn't solve the problem because of LANG=en_US.UTF-8, but because "unrar ..." in that shell script starts another version of unrar.

I changed the unrar.sh script to verify this: First I removed the LANG=... line so the script only contained these lines:

Code: Select all

#!/bin/sh
unrar "$@"
exit $?
I rerun my tests and the extraction still worked perfectly.

So now I changed my script again to include the export line again and also force the usage of the unrar file shipped with NZBget:

Code: Select all

#!/bin/sh
export LANG=en_US.UTF-8
$(dirname $0)/unrar "$@"
exit $?
And there the error reoccurred unfortunately.

So here is what I know so far:
  • export LANG=en_US.UTF-8 doesn't seem to help at all
  • unrar in version 5.21 (the one my NAS comes with) doesn't have those problems
  • unrar in version 5.70 (the one shipped with NZBget) seems to have problems with those characters

Currently I don't know how to solve this tbh. 5.70 seems to be important and brings new features so I don't want to use the old one. But I don't know what's wrong with 5.70, maybe it doesn't support unicode and has to be replaced with another version?

Not sure what to do here...