LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-08-2015, 03:07 PM   #1
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
UTF-8 / Unifont Issue


I set up my slackware install with UTF-8 by uncommenting "export LANG=en_US.UTF-8" in /etc/profile.d/lang.sh and commenting "export LANG=en_US" which seems to work for the most part. However when I try to use a command to ssh into a remote server and automatically attach a tmux session it fails.

Code:
ssh server -M -S /tmp/orbea@server:22 -t tmux a
But if I do it in separate steps unifont chars are magically enabled like everywhere else:

Code:
ssh server -M -S /tmp/orbea@server:22
tmux a
And a simpler command unifont still doesn't work:

Code:
ssh server -t tmux a
I'm struggling to figure out why unifont is enabled everywhere but if I use my command, here is some info if it helps:

Code:
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE=C
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="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"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Code:
$ locale charmap
UTF-8
Code:
$ cat /etc/profile.d/lang.sh 
#!/bin/sh
# Set the system locale.  (no, we don't have a menu for this ;-)
# For a list of locales which are supported by this machine, type:
#   locale -a

# en_US is the Slackware default locale:
#export LANG=en_US

# 'C' is the old Slackware (and UNIX) default, which is 127-bit
# ASCII with a charmap setting of ANSI_X3.4-1968.  These days,
# it's better to use en_US or another modern $LANG setting to
# support extended character sets.
#export LANG=C

# There is also support for UTF-8 locales, but be aware that
# some programs are not yet able to handle UTF-8 and will fail to
# run properly.  In those cases, you can set LANG=C before
# starting them.  Still, I'd avoid UTF unless you actually need it.
export LANG=en_US.UTF-8

# Another option for en_US:
#export LANG=en_US.ISO8859-1

# One side effect of the newer locales is that the sort order
# is no longer according to ASCII values, so the sort order will
# change in many places.  Since this isn't usually expected and
# can break scripts, we'll stick with traditional ASCII sorting.
# If you'd prefer the sort algorithm that goes with your $LANG
# setting, comment this out.
export LC_COLLATE=C

# End of /etc/profile.d/lang.sh
 
Old 02-09-2015, 10:20 AM   #2
Totoro-kun
Member
 
Registered: Nov 2010
Location: Kaunas, Lithuania
Distribution: Slackware
Posts: 234

Rep: Reputation: 125Reputation: 125
Hello,
Unicode support is four part thing. Kernel support (lilo.conf entry), locale setting (/etc/profile.d/lang.sh lang.csh), font (/etc/rc.d/rc.font) and input.

Slackware includes a good unicode font (Terminus), you can enable it by editing your /etc/rc.d/rc.font:

Code:
#!/bin/sh
#
# This selects your default screen font from among the ones in
# /usr/share/kbd/consolefonts.
#
setfont -v ter-v16n
and making it executable:

Code:
# chmod 755 /etc/rc.d/rc.font
You can reboot your system to take effect, or set it manually:
Code:
 # sh /etc/rc.d/rc.font
To set keymap, you need to edit /etc/rc.d/rc.keymap file, to something like this:

Code:
#!/bin/sh
# Load the keyboard map.  More maps are in /usr/share/kbd/keymaps.
if [ -x /usr/bin/loadkeys ]; then
 /usr/bin/loadkeys lt.map
fi
Please look in /usr/share/kbd/keymaps, because lt.map will set Lithuanian keyboard layout for you Also, you need to make rc.keymaps executable and to start it (same way as with rc.font)

Anyway, hope that helps. If not, you should tinker with your client (eg. putty) settings in order to use UTF-8
 
Old 02-09-2015, 04:07 PM   #3
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
Hi, thanks for the reply and info, the first part was also something I was going to work on later, but not really what I was having issues with. I use that command in urxvtd/urxvtc which obviously supports unicode and has always just worked in debian for me. However in slack I get this:

http://s11.postimg.org/r3atzhis1/test.png

The left one is opened with two commands.

Code:
ssh server -M -S /tmp/orbea@server:22
tmux a #to attach tmux while in the ssh
The one on the right is opened with a single more convenient command which for some reason slackware dislikes, but is fine in debian.
Code:
ssh server -M -S /tmp/orbea@server:22 -t tmux a
#automatically attaches tmux session after sshing into the server
Unicode seems to be working fine everywhere except when I use that command which I use enough to have it keybound. I don't get why its not working...

Edit: Also some commands done on the server.

Code:
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="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"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Code:
$ locale charmap
UTF-8

Last edited by orbea; 02-09-2015 at 04:15 PM.
 
Old 02-20-2015, 01:32 PM   #4
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,090

Rep: Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173
have you enabled utf-8 in the ~/.tmux.conf of your server? mine contains the line
Code:
set -g utf8 on
 
2 members found this post helpful.
Old 02-20-2015, 10:14 PM   #5
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
I didn't have a a ~/.tmux.conf, I imagine I was just using the default configuration so I created one and added that line, no change. Even closed my session and started a fresh one to make sure. Thanks for the suggestion!

Edit: And I just checked on my other computer that it still just works in debian...

Last edited by orbea; 02-20-2015 at 10:15 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to input non-utf characters from utf-8 linux enviroment? jadas Linux - General 6 02-07-2009 03:20 PM
Converting UTF-16 files to another encoding (such as UTF-8) crisostomo_enrico Solaris / OpenSolaris 3 03-25-2008 05:30 PM
im getting UTF-8 to STRING: Could not open converter from 'UTF-8' to 'ISO-8859-1' jabka Linux - Newbie 2 11-24-2006 05:44 AM
[Enter] in text documents diffrent on Windows and Linux? UTF-8/UTF-16 problem or? brynjarh Linux - General 1 11-24-2004 05:20 AM
X11 / UTF-8 locale seems missing 'fr_FR.UTF-8' chrsitophermann Debian 11 07-17-2004 02:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration