[2.0.0Alpha1] encoding warning message [Ubuntu]

Questions and bug reports for Beta releases should be posted here.
Forum rules
Help us help you:
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
nhasian
Newbie
Newbie
Posts: 9
Joined: December 29th, 2009, 1:03 am

[2.0.0Alpha1] encoding warning message [Ubuntu]

Post by nhasian »

after upgrading to 2.0.0Alpha1 I receive this warning message:
SABnzbd was started with encoding ANSI_X3.4-1968, this should be UTF-8. Expect problems with Unicoded file and directory names in downloads.
However when I check my config file it says:
__version__ = 19
__encoding__ = utf-8
I don't know if it's related but I just noticed on the general tab it says this:
Python Version: 2.7.12 (default, Nov 19 2016, 06:48:10) [GCC 5.4.0 20160609] [ANSI_X3.4-1968]

User avatar
sander
Release Testers
Release Testers
Posts: 7128
Joined: January 22nd, 2008, 2:22 pm

Re: [2.0.0Alpha1] encoding warning message

Post by sander »

nhasian wrote:after upgrading to 2.0.0Alpha1 I receive this warning message:
SABnzbd was started with encoding ANSI_X3.4-1968, this should be UTF-8. Expect problems with Unicoded file and directory names in downloads.
Which platform? Linux ...? NAS ....? ... ?


The encoding of your config file is just the encoding of your config file, NOT how SABnzbd is started.

nhasian
Newbie
Newbie
Posts: 9
Joined: December 29th, 2009, 1:03 am

Re: [2.0.0Alpha1] encoding warning message

Post by nhasian »

Oops sorry I am running it on an Ubuntu Linux Server. I use systemd to start it.
sander wrote:
nhasian wrote:after upgrading to 2.0.0Alpha1 I receive this warning message:
SABnzbd was started with encoding ANSI_X3.4-1968, this should be UTF-8. Expect problems with Unicoded file and directory names in downloads.
Which platform? Linux ...? NAS ....? ... ?


The encoding of your config file is just the encoding of your config file, NOT how SABnzbd is started.

User avatar
sander
Release Testers
Release Testers
Posts: 7128
Joined: January 22nd, 2008, 2:22 pm

Re: [2.0.0Alpha1] encoding warning message

Post by sander »

I am running it on an Ubuntu Linux Server.
OK
I use systemd to start it.
Ah, I know little about systemd etc. Do you use the PPA?

First some introduction:

SABnzbd has introduced Unicode some versions ago. That works. However, you also need to start SABnzbd with the correct encoding / locale. SAB has been reporting for a long time:

Code: Select all

2017-03-04 12:14:49,738::INFO::[sabnzbdplus:1190] Preferred encoding = UTF-8
For 2.0.0, we've decided to warn Linux-users in case of non-UTF encoding because that causes problems in case of certain downloads.
And you're one of the first volunteers. ;)

FWIW: I run 2.0.0Alpha1 on my Ubuntu 14.04 server too, and no problems.

It's about the "locale" that is used. Check with "locale". On my Ubuntu server:

Code: Select all

[email protected]:~$ locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=nl_NL.UTF-8
LC_TIME=nl_NL.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=nl_NL.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=nl_NL.UTF-8
LC_NAME=nl_NL.UTF-8
LC_ADDRESS=nl_NL.UTF-8
LC_TELEPHONE=nl_NL.UTF-8
LC_MEASUREMENT=nl_NL.UTF-8
LC_IDENTIFICATION=nl_NL.UTF-8
LC_ALL=
Google "locale ubuntu" to read how to set it.

If you use systemd, maybe the locale or LANG setting is changed in the script.


You can also do this:
Stop sabnzbd as a service,
Start sabnzbd from the commandline:

Code: Select all

env LANG=c sabnzbdplus
... will go wrong

Code: Select all

env LANG=en_US.UTF-8 sabnzbdplus
... will be OK, but only if you have locale en_US.UTF-8 installed, which you can check with "locale -a"

User avatar
sander
Release Testers
Release Testers
Posts: 7128
Joined: January 22nd, 2008, 2:22 pm

Re: [2.0.0Alpha1] encoding warning message [Ubuntu]

Post by sander »

For reference / Google: a variant is

Code: Select all

SABnzbd was started with encoding ISO-8859-15, this should be UTF-8. Expect problems with Unicoded file and directory names in downloads.
which I got on my Debian on ARM.

And this how I solved it:

Code: Select all

locale 
sudo dpkg-reconfigure locales ### I removed everything but en_US.UTF-8
exit ### and a new login

locale ### Yes, LANG=en_US.UTF-8
cat /etc/default/locale 
sabnzbdplus ### Preferred encoding = UTF-8

Code: Select all

[email protected]:~$ locale | grep LANG=
LANG=en_US.UTF-8

[email protected]:~$ env | grep LANG
LANG=en_US.UTF-8


nhasian
Newbie
Newbie
Posts: 9
Joined: December 29th, 2009, 1:03 am

Re: [2.0.0Alpha1] encoding warning message [Ubuntu]

Post by nhasian »

To correct this error message on Ubuntu 16.04.2 LTS I had to run the command:

Code: Select all

sudo dpkg-reconfigure locales
I chose en_US.UTF-8 from the list then was presented with two choices:

C.UTF-8
en_US.UTF-8

I don't know what the difference is but I selected en_US.UTF-8. Then I restarted sabnzbd and the warning message disappeared.

User avatar
sander
Release Testers
Release Testers
Posts: 7128
Joined: January 22nd, 2008, 2:22 pm

Re: [2.0.0Alpha1] encoding warning message [Ubuntu]

Post by sander »

Then I restarted sabnzbd and the warning message disappeared.
Cool. You can now download posts with Unicode files within the rars.

Post Reply