Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LANG and LC_CTYPE env variables cause many issues with unicode chars #607

Closed
lordgiotto opened this issue Aug 11, 2016 · 6 comments
Closed
Labels
help wanted Contributions wanted towards the issue 🐛 Type: Bug Issue pertains to something wrong within Hyper

Comments

@lordgiotto
Copy link
Contributor

Hyperterm sets LANG variable in app/session.js, but the way we are doing it creates some problems.

Since LC_CTYPE inherits from LANG variable, if the locale name returned by app.getLocale() is not an XPG syntax described by gnu.org here (LANGUAGE_TERRITORY.CHARSET) and it's not found in locales list locale -a, shell will fail with some unicode special chars, causing issues like #183, #597, #441 and probably #589.

I also noticed that, if locale is not set correctly like described above, alt key is used as metakey, despite hterm 'alt-sends-what' is set to 'browser-key' here.

A temporary workaround is to manually set the right locale for you in your .bashrc/.zshrc: for me it's export LANG=it_IT.UTF-8.

Hope it helps 😄

@lordgiotto lordgiotto changed the title LANG and LC_CTYPE env variable causes many issues with unicode chars LANG and LC_CTYPE env variables causes many issues with unicode chars Aug 11, 2016
@lordgiotto lordgiotto changed the title LANG and LC_CTYPE env variables causes many issues with unicode chars LANG and LC_CTYPE env variables cause many issues with unicode chars Aug 11, 2016
@hoffi
Copy link

hoffi commented Aug 11, 2016

The workaround solves my issue #589.
I have set the LANG variable to de_DE.UTF-8 in my fish config (was de.UTF-8) and it helped.

@timothyis timothyis added 🐛 Type: Bug Issue pertains to something wrong within Hyper help wanted Contributions wanted towards the issue labels Aug 12, 2016
@Arttse
Copy link

Arttse commented Oct 27, 2016

A temporary workaround is to manually set the right locale for you in your .bashrc/.zshrc: for me it's export LANG=it_IT.UTF-8.

Not fully worked for me with locale ru_RU.
Hyper version 0.8.3.

I checked the locale:

$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: ?????????? ?????????? LC_ALL ? ?????? ?? ?????????.: ??? ?????? ????? ??? ????????
LANG=ru_RU.UTF-8
LANGUAGE=ru_RU
LC_CTYPE=ru.UTF-8
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=

I saw that the variable LC_CTYPE is set incorrectly.

So for me, a working version was like this:

export LANG=ru_RU.UTF-8
export LC_CTYPE=ru_RU.UTF-8

Put this to your .bashrc or .zshrc, replacing to your locale instead of ru_RU.

@dunst0
Copy link

dunst0 commented Jan 25, 2017

Works for me as well had locale errors when using ssh client

@ZeFifi
Copy link

ZeFifi commented Oct 27, 2017

Hi guys, I had the same issue, here's what I did to fix it (no é, è, à, ù, etc characters were well displayed) :

Made sure my library language was installed: sudo install language-pack-fr-base (for french)
Then, allowed Ubuntu to automatically configure it: sudo dpkg-reconfigure locales
Finally: export LC_ALL="fr_FR.utf-8"

Hope it helps!

@onip
Copy link

onip commented Dec 14, 2017

this also causes problems with ssh tab-completion.

@sebastienschoepfer
Copy link

Hello,
I'm facing this kind of problem on Windows environment with Powershell. Is there a workaround for this case (more information there : #2817) ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions wanted towards the issue 🐛 Type: Bug Issue pertains to something wrong within Hyper
Projects
None yet
Development

No branches or pull requests

8 participants