Skip to content

Locale incorrectly set #1

@gravelld

Description

@gravelld

I had a report from a user using this project, I wanted to share:

One thing I noticed in the switch from Windows (with the data on FreeBSD
via samba) to native BSD - I feel like bliss is now missing some albums,
or sometimes single files. I think this is related to special characters
in filenames. Here are a couple of examples:

I have a set of downloaded Goon Shows from some archive in the distant
past - two episodes didn't get their genre corrected because they have a
GBP symbol in the name (this may or may not paste correctly in a
plaintext email):

"The Goon Show - S09 - E03 - The £1,000,000 Penny.mp3"

An entire album was missed because the band name had u-umlaut ("Amon
Düül II").

I suggested the user run locale to review the locale configuration settings. The result was:

$ locale 
LANG=en_US.UTF-8 
LC_CTYPE="en_US.UTF-8" 
LC_COLLATE="en_US.UTF-8" 
LC_TIME="en_US.UTF-8" 
LC_NUMERIC="en_US.UTF-8" 
LC_MONETARY="en_US.UTF-8" 
LC_MESSAGES="en_US.UTF-8" 
LC_ALL= 

Which looks fine. But I also reviewed the bliss about file in the debug archive. This showed:

...
sun.jnu.encoding=US-ASCII
...
LANG=en_US

sun.jnu.encoding is the encoding used to decode file names, and should be a UTF encoding really. LANG appears incorrectly set, it should normally have an encoding suffix.

When the user overrode LANG as so:

LANG=en_US.UTF-8

The files were found ok.

The user added:

I must say, it was puzzling - I could add "echo $LANG" to that script 
and it would happily tell me "en_US.UTF-8", despite the evidence against 
that from bliss itself. However, I added "export LC_ALL="en_US.UTF-8" to 
the script and everything is fine after that - the "about" debug file 
shows "sun.jnu.encoding=UTF-8", and the previously-missing files are now 
found. 

That rc script runs bliss using the "daemon" utility, so it must be 
something to do with the environment set up by that. It sounds like 
defining the locale systemwide in /etc/login.conf might be the correct 
way to fix this, but it's working this way so good for now! 

So not sure if daemon is doing something... or what!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions