Raspbmc on Pi B and osmc on Pi 2, locale difference

By using ‘sudo dpkg-reconfigure locales’, I have set locale
to the ‘hr_HR.UTF-8’ on both operating systems. On osmc (Pi 2)
locale command returns:

osmc@osmc:~$locale
LANG=hr_HR.UTF-8
LANGUAGE=
LC_CTYPE=“hr_HR.UTF-8”
LC_NUMERIC=“hr_HR.UTF-8”
LC_TIME=“hr_HR.UTF-8”
LC_COLLATE=“hr_HR.UTF-8”
LC_MONETARY=“hr_HR.UTF-8”
LC_MESSAGES=“hr_HR.UTF-8”
LC_PAPER=“hr_HR.UTF-8”
LC_NAME=“hr_HR.UTF-8”
LC_ADDRESS=“hr_HR.UTF-8”
LC_TELEPHONE=“hr_HR.UTF-8”
LC_MEASUREMENT=“hr_HR.UTF-8”
LC_IDENTIFICATION=“hr_HR.UTF-8”
LC_ALL=

In python3:

sys.getfilesystemencoding()
‘utf-8’

The same setup on raspbmc (Pi B) returns:
pi@raspbmc:~$ locale
LANG=
LANGUAGE=
LC_CTYPE=“POSIX”
LC_NUMERIC=“POSIX”
LC_TIME=“POSIX”
LC_COLLATE=“POSIX”
LC_MONETARY=“POSIX”
LC_MESSAGES=“POSIX”
LC_PAPER=“POSIX”
LC_NAME=“POSIX”
LC_ADDRESS=“POSIX”
LC_TELEPHONE=“POSIX”
LC_MEASUREMENT=“POSIX”
LC_IDENTIFICATION=“POSIX”
LC_ALL=

In python3:

sys.getfilesystemencoding()
‘ascii’

I have a python3 script that works with no problems on osmc
or windows, but due to the locale setup, not at all, on raspbmc.

How to setup locale on raspbmc to be the same as osmc?

Raspbmc didn’t handle locales as gracefully

dpkg-reconfigure locales should help you though

S

I already used dpkg-reconfigure locales (my first post), but locale is always set to POSIX, and than I have problems with Croatian letters.
My goal is to preserve Croatian keyboard (currently croatian keys on keyboard don’t work), but at the same time to be able to have file names in UTF-8.
As dpkg-reconfigure locales doesn’t work, do I have any other option?

I have solved the problem for raspbmc root user by adding the following to the /etc/rc.local file:

LANG=hr_HR.UTF-8
export LANG

For pi user, I have added the same in the /etc/profile file, and now everything works as it should.

I hope this will help to someone.
Regards.