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

Core installation should set proper locale for Unicode characters. #85

Closed
GirlBossRush opened this issue Mar 29, 2013 · 10 comments · Fixed by #133
Closed

Core installation should set proper locale for Unicode characters. #85

GirlBossRush opened this issue Mar 29, 2013 · 10 comments · Fixed by #133
Labels

Comments

@GirlBossRush
Copy link

I battled with Unicode character issues for about a week and found the solution to my troubles. My chroot installation is the core package and I use Crosh Window to login. I use ZSH as my shell with Oh-My-ZSH and the default theme has a Unicode arrow next to the command line. Tab completion would duplicate the text on the screen until I found that the locale was not set. Running:

sudo locale-gen en_US.UTF-8 UTF-8
sudo update-locale LANG="en_US.UTF-8"

Will fix the issue for good. I'm not sure if it's possible to include this fix in the installation or at least document the issue for other users.

@dnschneid
Copy link
Owner

That almost certainly should go into the install, probably in post-common. I'll look into it. Thanks for figuring this out!

Do you have to set LANG when you enter the chroot later, or does it grab it by default?

@dnschneid
Copy link
Owner

I had to run sudo locale-gen en_US.UTF-8 (no UTF-8 second parameter) for it to actually generate the locale and for the second command to work. This is on Quantal--which is yours?

@GirlBossRush
Copy link
Author

I'm on Precise. I've pieced these commands from a number of StackOverflow posts so YMMV. LANG seems to get set automatically now that the locale is generated.

@x3qt
Copy link
Contributor

x3qt commented Apr 1, 2013

Also, do not forget to set "LC_ALL=en_US.UTF-8".

@GirlBossRush
Copy link
Author

I haven't had any issues with LC_ALL not set. What does it fix?

@x3qt
Copy link
Contributor

x3qt commented Apr 2, 2013

Depends on order, so it preferable to be set explicitely. Not everyone lives in the US or uses the english language as the default.

Example of /etc/default/locale:

LANG="en_UK.UTF-8"
LC_ALL="en_US.UTF-8"

See for an additional info - https://help.ubuntu.com/community/Locale

@tedm
Copy link
Contributor

tedm commented Apr 2, 2013

A work around I've done is to put my LANG= and LC_ALL= in my home .profile and .bashrc

use export in front of if necessary.

set and printenv show them set.

When I did the standard global profile commands (for debian/ubuntu), I got "POSIX" for all of the variables.

@dnschneid
Copy link
Owner

Fixed in master, thanks to @x3qt.

@torsava
Copy link

torsava commented Mar 23, 2016

The problem persists, and it's a bit different to solve it on Debian sid:

  • Open file /etc/locale.gen in your favourite text editor.
  • Uncomment line "# en_US.UTF-8 UTF-8" and save file.
  • sudo locale-gen
  • sudo update-locale LANG="en_US.UTF-8"
  • sudo update-locale LC_ALL="en_US.UTF-8"

That should do it. Happy chrooting!

@0xMF
Copy link

0xMF commented Jul 3, 2018

As there was no file /etc/locale.gen in the default install of Debian sid (xfce4), I solved this issue as follows:

  1. Add locales to Debian sid and configure
  • sudo apt install locales
  • sudo dpkg-reconfigure locales
  • In the dialog that appears: Select "en_US.UTF-8 UTF-8" and click OK
  1. Update xfce4-terminal settings to show Unicode (Edit->Preferences->Advanced->Encoding and select UTF-8).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants