unrar: filename with German special characters

Get help, report and discuss bugs.
rolmei
Posts: 51
Joined: 13 Apr 2013, 15:52

unrar: filename with German special characters

Post by rolmei » 10 Feb 2017, 17:38

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

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: unrar: filename with German special characters

Post by hugbug » 10 Feb 2017, 18:33

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?

rolmei
Posts: 51
Joined: 13 Apr 2013, 15:52

Re: unrar: filename with German special characters

Post by rolmei » 11 Feb 2017, 14:25

THX
Here are twio examples.
The nzb file with extension jpg, otherwise no upload
Attachments
Brigitte Woman - Maerz 2017.log
(4.67 KiB) Downloaded 321 times
Brigitte Woman - Maerz 2017.jpg
Brigitte Woman - Maerz 2017.nzb.log
(35.28 KiB) Downloaded 385 times

rolmei
Posts: 51
Joined: 13 Apr 2013, 15:52

Re: unrar: filename with German special characters

Post by rolmei » 11 Mar 2017, 22:20

No ideas

rolmei
Posts: 51
Joined: 13 Apr 2013, 15:52

Re: unrar: filename with German special characters

Post by rolmei » 11 Aug 2019, 13:34

Where is the log of unrar?

sanderj
Posts: 184
Joined: 10 Feb 2014, 21:46

Re: unrar: filename with German special characters

Post by sanderj » 11 Aug 2019, 14:52

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

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: unrar: filename with German special characters

Post by hugbug » 11 Aug 2019, 19:16

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.

al3x
Posts: 28
Joined: 24 Aug 2017, 17:13

Re: unrar: filename with German special characters

Post by al3x » 04 Oct 2019, 19:41

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 ;)
Last edited by al3x on 06 Oct 2019, 11:06, edited 3 times in total.

sanderj
Posts: 184
Joined: 10 Feb 2014, 21:46

Re: unrar: filename with German special characters

Post by sanderj » 06 Oct 2019, 08:01

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

al3x
Posts: 28
Joined: 24 Aug 2017, 17:13

Re: unrar: filename with German special characters

Post by al3x » 06 Oct 2019, 12:34

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...

Post Reply

Who is online

Users browsing this forum: No registered users and 57 guests