Unable to see some Russian id3 tags in ncmpc

0

I'm running urxvt with the current env:

$ env | grep LC
LC_ALL=en_US.UTF-8

The problem is either with ncurses or ncmpc and I was wondering if anyone could shed some light on what the problem might be. This could also be an issue with the ID3 tags and any advice on working with broken or misconfigured encoding settings in meta tags in mp3 files is also welcome. I have been ignoring this matter for years and it has finally gotten to me. The bizarre thing is that some filenames or tags work, while others do not.

What I have tried the following:

  • setting LC_ALL to these values (whatever is before the space)

    • ru_RU.KOI8-R KOI8-R
    • ru_RU.UTF-8 UTF-8
    • ru_RU ISO-8859-5

  • rebuilding the MPD database with

    • id3v1_encoding "ISO-8859-1"
      or
    • id3v1_encoding "UTF-8"

I can demonstrate the problem with two screen shots, as it's the easiest way to do so:

Expected output (mpc works well):

expected output

Broken encoding (ncmpc):

broken encoding

Ncmpcpp: same problem

ncmpcpp: same  problem

Ярослав Рахматуллин

Posted 2012-10-09T15:22:08.430

Reputation: 9 076

Answers

0

From the second screenshot, it looks like ncmpcpp outputs valid UTF-8, but your terminal does not expect it.

Find out the PID of your terminal emulator, then run

cat /proc/<PID>/environ | tr \\0 \\n | egrep "LANG|LC"

If it shows something different than your current locale, then you're likely setting $LANG/$LC_ALL in the wrong place. For example, .bashrc won't work because it is not applied to the X11 session, only to programs inside a terminal – .profile or .xprofile would be better.

In fact, setting $LC_ALL permanently is not recommended – just LANG=en_US.UTF-8 should be enough. (Try to avoid ISO-8859 or KOI8-R settings.)

user1686

Posted 2012-10-09T15:22:08.430

Reputation: 283 655

The application in the screen-shot is ncmpc, not ncmpcpp. $ cat /proc/9411/environ (...): LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8. I start X with startx, so the locale variables in subsequent terminals are set to the same values as they are when X launces. If the terminal had not expected UTF-8, then mpc (mpc-whatson) would certainly not show the correct characters, but it does. I included the mpc screen-shot only to show that. The weird part is that some tags work, while others do not. That's also part of the question, and if locale vars were bad, none of them would work. – Ярослав Рахматуллин – 2012-10-09T17:19:03.133