WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: tc and self made locales (building ncmpcpp)  (Read 3525 times)

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
tc and self made locales (building ncmpcpp)
« on: August 17, 2010, 04:42:22 PM »
I have tried to build ncmpcpp (a ncurses based client for mpd). It works well with locale "C", even the German special characters (umlauts) are displayed properly.

But now comes the curiosity :

Switching locale to "de_DE.UTF-8", ncmpcpp shows the German umlauts not correctly!

I have exactly the opposite result expected ("C"=bad, "de"=OK).

What is wrong here?

Tao

PS:
I tried building some other locales with UTF-8 and ISO-8859-1 (eg "en_US.utf8", "en_US.iso88591") all with the same bad result: Special characters are displayed incorrectly - only locale "C" works.
« Last Edit: August 17, 2010, 04:48:59 PM by TaoTePuh »

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: tc and self made locales (building ncmpcpp)
« Reply #1 on: August 17, 2010, 08:10:05 PM »
Okay, it does seem that the current tc version of ncurses is the problem. I have ncurses rebuilt for my own with the option --enable-widec (compile with wide-char/UTF-8 code) and then again ncmpc and ncmpcpp. Both programs now work with locale "de_DE-UTF-8".

I suspect that this (ncurses) is the reason why the current tc version of mc does not work with "UTF-8".


Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: tc and self made locales (building ncmpcpp)
« Reply #2 on: August 18, 2010, 01:17:53 AM »
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: tc and self made locales (building ncmpcpp)
« Reply #3 on: August 18, 2010, 04:21:05 AM »
Use a non-utf8 locale in the meantime, ie just de_DE or de_DE@euro.
The only barriers that can stop you are the ones you create yourself.

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: tc and self made locales (building ncmpcpp)
« Reply #4 on: August 18, 2010, 08:34:42 AM »
@bmarkus
Thanks for the link. Now I know that (current) do not harmonize tc and utf-8. And it does not appear, as would that be in the near future. That is very unfortunate ...

@curaga
Thanks for the hint. But, sadly, that I am living here in an utf-8 environment. I therefore need utf-8 for at least the filesystem (samba shares).

Do you know a way to set locale to non-utf-8 but still working successful with an utf-8-filersystem?

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: tc and self made locales (building ncmpcpp)
« Reply #5 on: August 18, 2010, 03:11:22 PM »
I'm under the impression that it should just work; what happens if you try?
The only barriers that can stop you are the ones you create yourself.

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: tc and self made locales (building ncmpcpp)
« Reply #6 on: August 19, 2010, 06:09:38 PM »
Now I have tried several configurations. The following works well, but I still have a big problem (see below).

  • Locale: de_DE@euro (build with "localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro")
  • Bootoption: lang=de_DE@euro
  • Bootoption: kmap=de
  • loading coreutils on startup (onboot.lst)
  • mounting samba-shares with option iocharset=iso8859-15
  • for ssh-sessions: switch coding in terminal to ISO-8859-15

I can see file names with special characters (german umlauts) in aterm, LXTerm and via ssh session:

Code: [Select]
echo "äöü€" > file_äöü€.txt
cat file_äöü€.txt
äöü@€

EmelFM2 also shows the names correctly.

But if I e.g. use geany to open a file, the file name will not display properly. Even with, for example PCManFM the file names are not displayed correctly.

Could it be that there is a problem with GTK?

Offline TaoTePuh

  • Full Member
  • ***
  • Posts: 172
Re: tc and self made locales (building ncmpcpp)
« Reply #7 on: August 19, 2010, 09:33:17 PM »
My fault. I just had to change G_FILENAME_ENCODING=iso8859-15 in /etc/profile.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: tc and self made locales (building ncmpcpp)
« Reply #8 on: August 20, 2010, 04:30:51 AM »
Yeah, GTK doesn't have autodetection if you don't tell it to:

export G_FILENAME_ENCODING=@locale
The only barriers that can stop you are the ones you create yourself.