anti | 11 Jun 2012 10:11

Different encoding on tty's and X, solution (or workaround?)

I noticed today that my zsh-prompt in the tty's didn't show the same
letters as in the terminal emulators. First I thought I might have a
corrupted ~/.zshrc.local, but while it showed the correct encoding in
geany as well as in the terminal editors in X, it showed a sequence of
letters (sth like "ßäü") instead of "┌─" when editing it in the tty.
Invoking 'locale -a' shows as possible locales "en_GB.utf8", while my
locale in rc.conf was set to "en_GB.UTF-8". Changing the line in rc.conf
to the locale given by locale -a and rebooting solved the problem.
My questions:
1. Did I find a solution to my problem, or a mere workaround that might
create more problems after future updates?
2. Is the incorrect encoding in tty's a serious problem that might
deserve some warning on the forums or even an announcement, or rather
something more or less cosmetic?
3. (Now I admit to be a newbie...) Is this problem maybe limited to zsh,
or does it also affect the majority(?) using bash?

Mateusz Loskot | 11 Jun 2012 11:29
Gravatar

Re: Different encoding on tty's and X, solution (or workaround?)

On 11 June 2012 09:11, anti <anti <at> lavabit.com> wrote:
> I noticed today that my zsh-prompt in the tty's didn't show the same
> letters as in the terminal emulators. First I thought I might have a
> corrupted ~/.zshrc.local, but while it showed the correct encoding in
> geany as well as in the terminal editors in X, it showed a sequence of
> letters (sth like "ßäü") instead of "┌─" when editing it in the tty.
> Invoking 'locale -a' shows as possible locales "en_GB.utf8", while my
> locale in rc.conf was set to "en_GB.UTF-8". Changing the line in rc.conf
> to the locale given by locale -a and rebooting solved the problem.
> My questions:
> [...]

I don't know direct answers to your questions, but I have noticed there
has been confusion regarding *.UTF-8 and *.utf8 locale postfix.

Here is similar thread on the forum:

https://bbs.archlinux.org/viewtopic.php?id=142848

I followed-up asking for clarification, ideally on the Wiki:

https://bbs.archlinux.org/viewtopic.php?pid=1112328#p1112328

but no responses so far.

IMO, it would be good to have it clarified.

Best regards,
--

-- 
Mateusz Loskot, http://mateusz.loskot.net
(Continue reading)

Martti Kühne | 11 Jun 2012 11:33
Picon

Re: Different encoding on tty's and X, solution (or workaround?)

On Mon, Jun 11, 2012 at 10:11:40AM +0200, anti wrote:
> I noticed today that my zsh-prompt in the tty's didn't show the same
> letters as in the terminal emulators. First I thought I might have a
> corrupted ~/.zshrc.local, but while it showed the correct encoding in
> geany as well as in the terminal editors in X, it showed a sequence of
> letters (sth like "ßäü") instead of "┌─" when editing it in the tty.
> Invoking 'locale -a' shows as possible locales "en_GB.utf8", while my
> locale in rc.conf was set to "en_GB.UTF-8". Changing the line in rc.conf
> to the locale given by locale -a and rebooting solved the problem.
> My questions:
> 1. Did I find a solution to my problem, or a mere workaround that might
> create more problems after future updates?

Heh... I just noticed locale -a shows the same lowercase .utf8 ending, while
/etc/locale.gen still contains the uppercase ones which I also considered
valid.

> 2. Is the incorrect encoding in tty's a serious problem that might
> deserve some warning on the forums or even an announcement, or rather
> something more or less cosmetic?
> 3. (Now I admit to be a newbie...) Is this problem maybe limited to zsh,
> or does it also affect the majority(?) using bash?
> 

Well, the real question is if the problem exists for any terminal program that
uses locale.h/setolocale. Will dig deeper later.

cheers!
mar77i

(Continue reading)

Mantas Mikulėnas | 11 Jun 2012 15:49
Picon
Gravatar

Re: Different encoding on tty's and X, solution (or workaround?)

On Mon, Jun 11, 2012 at 12:33 PM, Martti Kühne <mysatyre <at> gmail.com> wrote:
> On Mon, Jun 11, 2012 at 10:11:40AM +0200, anti wrote:
>> I noticed today that my zsh-prompt in the tty's didn't show the same
>> letters as in the terminal emulators. First I thought I might have a
>> corrupted ~/.zshrc.local, but while it showed the correct encoding in
>> geany as well as in the terminal editors in X, it showed a sequence of
>> letters (sth like "ßäü") instead of "┌─" when editing it in the tty.
>> Invoking 'locale -a' shows as possible locales "en_GB.utf8", while my
>> locale in rc.conf was set to "en_GB.UTF-8". Changing the line in rc.conf
>> to the locale given by locale -a and rebooting solved the problem.
>> My questions:
>> 1. Did I find a solution to my problem, or a mere workaround that might
>> create more problems after future updates?
>
> Heh... I just noticed locale -a shows the same lowercase .utf8 ending, while
> /etc/locale.gen still contains the uppercase ones which I also considered
> valid.

There shouldn't be any difference in behavior; see
<http://www.mail-archive.com/linux-utf8 <at> nl.linux.org/msg01694.html>
for an explanation.

The `tree` tool is one unfortunate exception. I never get around to
filing a bug report about it. Maybe initscripts and/or your shellrc
also have a broken test for ".utf-8"?

--

-- 
Mantas Mikulėnas

(Continue reading)

anti | 11 Jun 2012 17:42

Re: Different encoding on tty's and X, solution (or workaround?)


On 11/06/12 15:49, Mantas Mikulėnas wrote:
> On Mon, Jun 11, 2012 at 12:33 PM, Martti Kühne <mysatyre <at> gmail.com> wrote:
>> On Mon, Jun 11, 2012 at 10:11:40AM +0200, anti wrote:
>>> I noticed today that my zsh-prompt in the tty's didn't show the same
>>> letters as in the terminal emulators. First I thought I might have a
>>> corrupted ~/.zshrc.local, but while it showed the correct encoding in
>>> geany as well as in the terminal editors in X, it showed a sequence of
>>> letters (sth like "ßäü") instead of "┌─" when editing it in the tty.
>>> Invoking 'locale -a' shows as possible locales "en_GB.utf8", while my
>>> locale in rc.conf was set to "en_GB.UTF-8". Changing the line in rc.conf
>>> to the locale given by locale -a and rebooting solved the problem.
>>> My questions:
>>> 1. Did I find a solution to my problem, or a mere workaround that might
>>> create more problems after future updates?
>>
>> Heh... I just noticed locale -a shows the same lowercase .utf8 ending, while
>> /etc/locale.gen still contains the uppercase ones which I also considered
>> valid.
> 
> There shouldn't be any difference in behavior; see
> <http://www.mail-archive.com/linux-utf8 <at> nl.linux.org/msg01694.html>
> for an explanation.
> 
> The `tree` tool is one unfortunate exception. I never get around to
> filing a bug report about it. Maybe initscripts and/or your shellrc
> also have a broken test for ".utf-8"?
> 
I just checked my /var/log/boot, and there was a change from "Setting
Consoles to UTF-8 mode    [BUSY]    [DONE]" to "Configuring Virtual
(Continue reading)


Gmane