Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LANG environment variable in zsh

I recently installed sublime text on a new ubuntu machine. During start up I get the following error message :

Your system's locale is set to a value that can not handle non-ASCII characters. Package Control can not properly work unless this is fixed.

On Linux, please reference your distribution's docs for information on properly setting the LANG environmental variable. As a temporary work-around, you can launch Sublime Text from the terminal with:

   LANG=en_US.UTF-8 sublime_text

I checked for the following in the terminal (zsh shell) echo $LANG but this does not return anything i added the following two lines to the ~/.profile and restarted the terminal, but this did not help as echo $LANG did not return anything ?

How can I set my LANG env variable in zsh shell ?

like image 514
newbie Avatar asked Jul 28 '14 12:07

newbie


People also ask

What is LANG environment variable?

LANG is the normal environment variable for specifying a locale. As a user, you normally set this variable (unless some of the other variables have already been set by the system, in /etc/profile or similar initialization files).

How do I set environment variables in Terminal Mac?

It depends on the case, if you need a variable for just one time, you can set it up using terminal. Otherwise, you can have it permanently in Bash Shell Startup Script with “Export” command. And then close the terminal window and open another one to check out if the set variable has disappeared or not.


1 Answers

User

you can declare and export the LANG environment variable in your ~/.zshrc

export LANG=en_US.UTF-8

Logout and log-in again to activate.

System-wide

For a system wide configuration edit /etc/default/locale as follow:

LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"

Check

You can get information about your locale with:

locale
like image 50
Édouard Lopez Avatar answered Sep 21 '22 05:09

Édouard Lopez