Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

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.)

share|improve this answer
    
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. –  Ярослав Рахматуллин Oct 9 '12 at 17:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.