Weechat: Weechat 1.1 improperly discovers the terminal charset (Mac OS X)

Created on 16 Jan 2015  Â·  8Comments  Â·  Source: weechat/weechat

On the same terminal, running /charset, I receive different results if I use Weechat 1.0.1 vs 1.1

#1.0.1
charset: terminal: UTF-8, internal: UTF-8
#1.1
charset: terminal: US-ASCII, internal: UTF-8

This causes my unicode characters in weechat.conf (like ⤷) to be erased and replaced by ?.

I supposed it might be a regression as weechat 1.0.1 runs as expected. I installed Weechat via homebrew.

I try to play with charset.conf but I could not force the terminal charset with what I tried.

bug invalid

Most helpful comment

Thanks

export LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8"

did the trick. I was missing LC_CTYPE in my case.

I tried to find the culprit lib but could not.

All 8 comments

I can't reproduce this problem on Linux (and I have no way to test on Mac OS X).
Are you sure that both versions are compiled with exactly same options and linked with same libs?
If possible please try to compile yourself both versions with exactly same cmake options.

And by the way, I think nothing has changed between 1.0.1 and 1.1 about (terminal) charset detection (that's why I think something has changed on your build or your environment).

I started to have the same issue after a brew upgrade. I tried to do a downgrade to the previous version but, I got the same issue again.

It's probably due some other dependency that has been updated while executing the brew upgrade.

OK, then I close this issue.
If you think there's still a problem with charset, but another problem, feel free to open a new issue then.

You may want to try this export LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8"
It seems to fix the issue for me.

There is also LC_ALL which controls all the others. I have export LC_ALL=fi_FI.UTF-8 in my zshrc.

With tmux it's possible to use the following options, but the utf8 once have been called as dangerous (making troubleshooting more difficult if terminal really isn't UTF-8 and tmux forces it or something):

set -g utf8
set-window-option -g utf8 on
set -g default-terminal "screen-256color"

(the last is unrelated, but you might want it too.) I don't know how this happens with screen, but should be possible there too.

Thanks

export LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8"

did the trick. I was missing LC_CTYPE in my case.

I tried to find the culprit lib but could not.

macOS Terminal and iTerm2 provide a checkbox "Set locale environment variables on startup" and "Set locale variables automatically" respectively, that is checked by default, it's what causes LC_TYPE=UTF-8, which cause problems with terminal applications. Instead of fixing the variables a second time, I've just unchecked this option and my locale variables got back to normal.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FedericoCeratto picture FedericoCeratto  Â·  6Comments

Underdoge picture Underdoge  Â·  3Comments

mitchellwrosen picture mitchellwrosen  Â·  5Comments

victor-catalyst picture victor-catalyst  Â·  4Comments

mholt picture mholt  Â·  4Comments