Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Beta 4] Fix default locale settings

Featured Replies

Hi, I'm brazillian, and I have some difficulties setting up addons to read special characters correctly on mounted filesystems.

 

To make things work right, I have to install glibc on startup, then, before launch any executable, I export LANG and LC_ALL to en_US.utf8 . What I've found is that all FS mounted by emhttp uses UTF-8 charset, and bash uses ISO-8859-1.

 

Can you make all unRAID processes run using UTF-8 by default, Tom?

  • Author

Ok, I found this to be very easy to fix:

 

We have to add the locale files to the bzroot, that can be found under /usr/lib/locale; I think en_US and en_US.utf8 is enough.

 

Then, we have to edit /etc/profile.d/lang.sh in the bzroot to this:

#!/bin/sh
# Set the system locale.  (no, we don't have a menu for this ;-)
# For a list of locales which are supported by this machine, type:
#   locale -a

# en_US is the Slackware default locale:
export LANG=en_US.utf8

# 'C' is the old Slackware (and UNIX) default, which is 127-bit
# ASCII with a charmap setting of ANSI_X3.4-1968.  These days,
# it's better to use en_US or another modern $LANG setting to
# support extended character sets.
#export LANG=C

# There is also support for UTF-8 locales, but be aware that
# some programs are not yet able to handle UTF-8 and will fail to
# run properly.  In those cases, you can set LANG=C before
# starting them.  Still, I'd avoid UTF unless you actually need it.
#export LANG=en_US.UTF-8

# Another option for en_US:
#export LANG=en_US.ISO8859-1

# One side effect of the newer locales is that the sort order
# is no longer according to ASCII values, so the sort order will
# change in many places.  Since this isn't usually expected and
# can break scripts, we'll stick with traditional ASCII sorting.
# If you'd prefer the sort algorithm that goes with your $LANG
# setting, comment this out.
#export LC_COLLATE=C

# End of /etc/profile.d/lang.sh

 

And edit etc/profile.d/lang.csh in the bzroot to this;

#!/bin/csh
# Set the system locale.  (no, we don't have a menu for this ;-)
# For a list of locales which are supported by this machine, type:
#   locale -a

# en_US is the Slackware default locale:
setenv LANG en_US.utf8

# 'C' is the old Slackware (and UNIX) default, which is 127-bit
# ASCII with a charmap setting of ANSI_X3.4-1968.  These days,
# it's better to use en_US or another modern $LANG setting to
# support extended character sets.
#setenv LANG C

# There is also support for UTF-8 locales, but be aware that
# some programs are not yet able to handle UTF-8 and will fail to
# run properly.  In those cases, you can set LANG=C before
# starting them.  Still, I'd avoid UTF unless you actually need it.
#setenv LANG en_US.UTF-8

# Another option for en_US:
#setenv LANG en_US.ISO8859-1

# One side effect of the newer locales is that the sort order
# is no longer according to ASCII values, so the sort order will
# change in many places.  Since this isn't usually expected and
# can break scripts, we'll stick with traditional ASCII sorting.
# If you'd prefer the sort algorithm that goes with your $LANG
# setting, comment this out.
#setenv LC_COLLATE C

# End of /etc/profile.d/lang.csh

 

 

Result: no more encode errors!

Might want to send Lime Tech and email and point him to this thread.  It would make a nice addition and does not seem to be that hard to do.  He may be able to get it into the next release.

Might want to send Lime Tech and email and point him to this thread.  It would make a nice addition and does not seem to be that hard to do.  He may be able to get it into the next release.

I sent Tom a PM and did just that. 

Might want to send Lime Tech and email and point him to this thread.  It would make a nice addition and does not seem to be that hard to do.  He may be able to get it into the next release.

I sent Tom a PM and did just that.   

 

And I saw PM and added change.  This adds about 2MB to the root file system btw.

  • Author

Might want to send Lime Tech and email and point him to this thread.  It would make a nice addition and does not seem to be that hard to do.  He may be able to get it into the next release.

I sent Tom a PM and did just that. 

 

And I saw PM and added change.  This adds about 2MB to the root file system btw.

 

IMHO 2MB is nothing compared to have correct locale settings! Thank you very much, Tom, this will fix a lot of errors I was getting with SickBeard and Dropbox, and will improve all users shell experience.

 

Maybe someone who knows anything about locales can clear this up.

 

In /usr/lib/locale we have (among others):

 

/usr/lib/locale/en_US.utf8    <-- a directory

/usr/lib/locale/en_US.UTF-8  <-- does not exist

 

In /etc/profile.d/lang.sh, I can set this:

 

export LANG=en_US.utf8

or

export LANG=en_US.UTF-8

 

and both seem to work.  Seems the locale subsystem is a bit "forgiving" on the specification of the locale.  Which specification is correct?  (or perhaps both are correct?)

  • Author

The header of lang.sh and lang.csh have this instruction:

 

# Set the system locale.  (no, we don't have a menu for this ;-)

# For a list of locales which are supported by this machine, type:

#  locale -a

 

If we run "locale -a", it presents only en_US.utf8 as a result, so that should be the safest option to use.

 

But I agree with your impressions, the system seems to treat .UTF-8 and .utf8 as the same thing.

I hope that this will fix the 'default locale' errors reported by perl.

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.