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

Notices


View Poll Results: What locale/codeset do you use?
UTF-8 73 85.88%
ISO8859-1 9 10.59%
Other ISO8859-* 2 2.35%
Other 3 3.53%
Multiple Choice Poll. Voters: 85. You may not vote on this poll

Reply
  Search this Thread
Old 08-07-2014, 03:55 AM   #61
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196Reputation: 4196

Quote:
Originally Posted by WiseDraco View Post
your russian looks far better than my english
long time not receive any mails from you
Спасибо!

Check your inbox!

I must go to bed now, very late - I write slowly in Russian!

I will look for your reply tomorrow, I hope!

Спокойной ночи!

Last edited by astrogeek; 08-07-2014 at 04:07 AM.
 
1 members found this post helpful.
Old 08-07-2014, 05:29 AM   #62
Soderlund
Member
 
Registered: Aug 2012
Posts: 185

Rep: Reputation: 81
I need Swedish, Norwegian, Danish and Icelandic UTF-8 symbols and sometimes some other languages. Slackware has been my main distribution since I tried it for the first time (14.0) and everything works well for me. I've had some affairs with other distributions but I always come back to Slackware, because everything just works, including UTF-8. Slackware supremacy.

"Just works" doesn't mean that it has to work out of the box. Considering that Slackware is a distribution that thinks the whole world consists of the USA and Europe might as well be the Moon (the moon of Jupiter, perhaps), it is not bad that you can get full UTF-8 support in the console and X with just a few tweaks that take less than 10 minutes:

# Manuals

In order to make UTF-8 work in manuals, I added this to my $HOME/.profile:

Code:
LESSCHARSET='utf-8'
export LESSCHARSET

GROFF_ENCODING='utf8'
export GROFF_ENCODING
I think this will break system manuals that use the Latin-[1-n] encodings. Latin-1 is not compatible with UTF-8. ASCII manuals work fine though since UTF-8 is backward compatible with ASCII. Existing manuals could be converted with iconv (even automatically), but I haven't run in to any problems yet.

# Console

The console doesn't display most common Latin-1 symbols. So I use ter-v16n.psf (Terminus 512 chars) in the console. You can set it in /etc/rc.d/rc.font. Although Unicode contains many more than 512 symbols, this font covers nearly all UTF-8 symbols that I use.

Note that there are small (256) and big (512) console fonts. Big console fonts break some colors and bold text, but it's totally worth it.

# vi

elvis doesn't handle UTF-8. The program seems to assume that all encodings use single chars, but UTF-8 is a multi-byte (multiple chars) encoding. When you insert a Euro symbol, it correctly displays the symbol but it also prints 2 spaces (the Euro symbol uses 3 bytes). This is really bad because you can add the required UTF-8 support in C using only the ANSI C89 standard library with the mb* functions. Therefore I have replaced it with ex-vi, which handles UTF-8 perfectly.

# Almquist shell

/bin/ash can't enter UTF-8 symbols. Try it:

Code:
ash
å # doesn't work!
exit
/bin/dash (Debian Almquist shell) on Debian and the Heirloom-sh both handle it. I wanted to use ash as an interactive shell (because /bin/sh on Slackware is bash), so I use the Heirloom-sh instead.

# Other

Other than that it works fine!

LANG, LC_CTYPE = en_US.UTF-8 (having Swedish system messages makes it really hard to find error messages with search engines)

LC_COLLATE = C (for sorting)

LC_MONETARY, LC_NUMERIC, LC_TIME = sv_SE.UTF-8 (for cal, date et c.)

# X

You can not live without the compose key. (You can enable it in the console too but that entails editing the keymap file; Debian has an excellent program -- ckbcomp -- that can create console keymaps from X keymaps, which you can then use on Slackware.) In X, I bind the Menu key to compose:

Code:
setxkbmap -option compose:menu

Last edited by Soderlund; 08-07-2014 at 05:30 AM.
 
7 members found this post helpful.
Old 08-07-2014, 06:45 AM   #63
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Original Poster
Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Nice post Soderlund, thankyou.

I'd already discovered some of what you posted (elvis/ash), but I'll take a look at ex-vi and the heirloom shell as alternatives.

Btw, I also have compose set to menu (does anyone actually ever use that key for anything else? )
On the console, I've found that pressing both alts together enables compose mode without any editing necessary, but it uses different character sequences to compose on X, which is awkward, so yes, some editing is going to be necessary if one wants it to be consistent. (ckbcomp sounds very useful here - again thanks for the tip).
 
Old 08-07-2014, 04:04 PM   #64
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Original Poster
Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Just installed and had a play with ex-vi. Seems to work nicely for both utf-8 and sbcs. Given that 'elvis' doesn't work with UTF-8, do people think it should be put out to pasture and either ex-vi, or vim be used as the default vi in slackware?
 
Old 08-08-2014, 02:06 AM   #65
WiseDraco
Member
 
Registered: Nov 2006
Location: Europe,Latvia,Riga
Distribution: slackware,slax, OS X, exMandriva
Posts: 591

Rep: Reputation: 73
Quote:
Originally Posted by astrogeek View Post
Спасибо!

Check your inbox!

I must go to bed now, very late - I write slowly in Russian!

I will look for your reply tomorrow, I hope!

Спокойной ночи!
sorry for offtopic 2All !

Do you get my two mails? want to be sure, my mails reach you - i be almost sure, my mailserver not in any blackmail list, and also i have a SPF record, but - who knows?
 
Old 08-08-2014, 02:27 AM   #66
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 360

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by GazL View Post
Just installed and had a play with ex-vi. Seems to work nicely for both utf-8 and sbcs. Given that 'elvis' doesn't work with UTF-8, do people think it should be put out to pasture and either ex-vi, or vim be used as the default vi in slackware?
In this regard ex-vi is definitely better than elvis, but it lacks some features that elvis provides (syntax highlighting, multiple buffers and windows to name a few). Although if one requires more features than what traditional vi has, then why not use vim? I think ex-vi and vim would be a good combo to cover all editing needs.
 
Old 08-08-2014, 07:18 AM   #67
Soderlund
Member
 
Registered: Aug 2012
Posts: 185

Rep: Reputation: 81
You are welcome.

There is one thing that I haven't figured out yet: Unicode compose. Some sources say that you can press Ctrl-Shift-U and enter a Unicode code point, but it doesn't work for me in the console or in X. I think it might be a GNOME or KDE thing.

Quote:
Originally Posted by GazL View Post
Just installed and had a play with ex-vi. Seems to work nicely for both utf-8 and sbcs. Given that 'elvis' doesn't work with UTF-8, do people think it should be put out to pasture and either ex-vi, or vim be used as the default vi in slackware?
/usr/bin/vi is a symlink to elvis, and /usr/bin/ex is a symlink to vim. So ex-vi could even be included as /usr/bin/ex and /usr/bin/vi (-> ex) alongside elvis and vim.
 
Old 08-08-2014, 07:46 AM   #68
tronayne
Senior Member
 
Registered: Oct 2003
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541

Rep: Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065Reputation: 1065
Quote:
Originally Posted by GazL View Post
Just installed and had a play with ex-vi. Seems to work nicely for both utf-8 and sbcs. Given that 'elvis' doesn't work with UTF-8, do people think it should be put out to pasture and either ex-vi, or vim be used as the default vi in slackware?
Did you get the Unix toolchest ex? I've been using that, off and on, for some years in Slackware and it's worked well for me with the UTF-8 locale (right now it's off).

I notice that stock Slackware symbolically links /usr/bin/ex to /usr/bin/vim and /usr/bin/vi to /usr/bin/elvis. This has worked pretty much OK for my editing needs and I haven't had any significant problems as a result. I would note that in a Unix system, ex is vi (with a symbolic link in, for example Solaris); vi is just ex in visual mode after all.

Personally, I don't particularly like what vim does with all the eye candy -- I find it annoying with all the colors and other features (and don't want to fiddle with shutting them off). I like simple. Others like all that stuff, that's why we have a choice, eh?

You could just link /usr/bin/vi to /usr/bin/ex and see what's what? You'd have vim and that might just work for you?

Hope this helps some.
 
1 members found this post helpful.
Old 08-08-2014, 09:45 AM   #69
lems
Member
 
Registered: May 2004
Distribution: BSD
Posts: 269

Rep: Reputation: 119Reputation: 119
Just for completeness, there is also nvi, which is the default vi on most BSD systems (that's where I've learnt about it). I use the git version, which has some important DB fixes; recent versions display Kuhn's Unicode sample files well in an uxterm, had no problems so far (font used: -Misc-Fixed-Medium-R-Normal--18-120-100-100-C-90-ISO10646-1). Some of its features (from NetBSD's documentation):
  • Extended regular expressions (egrep style), enabled with option extended.
  • Tag stacks.
  • Infinite undo (to undo, press u; to continue undoing, press .).
  • Incremental search, enabled with the option searchincr.
  • Left-right scrolling of lines, enabled with the option leftright; the number of columns to scroll is defined by the sidescroll option.
  • Command line history editing, enabled with the option cedit.
  • Filename completion, enabled by the filec option.
  • Backgrounded screens and displays.
  • Split screen editing.

I use it almost exclusively; when it's not available I usually use plain old ed(1) (my favorite ed is the one from plan9port, whose `,' does the right thing) or the already mentioned gritter vi. (Though I have also been dabbling with vile [SlackBuild], which supports Unicode as well.)

PS: Regarding nvi: The only thing that's annoying is that when using `e' or `b' in command mode on a word with a unicode character (like the danish/norwegian Ø), it will treat the character as a word, so you have to press e or b more than once to get past `Søren', for example.

Last edited by lems; 08-08-2014 at 09:57 AM. Reason: Added PS
 
Old 08-08-2014, 09:57 AM   #70
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,061

Rep: Reputation: Disabled
Quote:
Originally Posted by Soderlund View Post
Some sources say that you can press Ctrl-Shift-U and enter a Unicode code point, but it doesn't work for me in the console or in X. I think it might be a GNOME or KDE thing.
It works including under Fluxbox, but it depends with which application. That works well in the Geany editor, and also in LQ's post editor in Firefox

Example:
U+00C6 LATIN CAPITAL LETTER AE:
Æ
Just press Ctrl-Shift-U, then enter 00C6 then press [Enter] or the spacebar here.

Last edited by Didier Spaier; 08-08-2014 at 10:31 AM.
 
3 members found this post helpful.
Old 08-08-2014, 11:00 AM   #71
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Original Poster
Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by tronayne View Post
Did you get the Unix toolchest ex? I've been using that, off and on, for some years in Slackware and it's worked well for me with the UTF-8 locale (right now it's off).
I built a ex-vi package from the sourceforge link that Soderlund provided above. uninstalled elvis, and installed the ex-vi executables directly to /usr/bin. I've been testing it as both a vi and ex (/usr/bin/vi -> /usr/bin/ex - replacing the /usr/bin/ex->/usr/bin/vim symlink that was there before). I've not played with 'Heirloom' or any other UNIX toolchest that may be out there.

It does seem a little odd that stock slackware has vi -> elvis, yet ex-> vim.


Quote:
Originally Posted by tronayne View Post
Personally, I don't particularly like what vim does with all the eye candy -- I find it annoying with all the colors and other features (and don't want to fiddle with shutting them off). I like simple. Others like all that stuff, that's why we have a choice, eh?
Yes, I agree, vim is far too colourful with its default colourscheme. 'elvis' was much nicer and simpler in that respect, but if elvis doesn't work with UTF-8 and the vast majority of people are now running UTF-8 systems (which looks likely based on the results of the attached poll) then that's kind of deal-breaker.

On a system that's still using a single byte character set, I'd be inclined to stick with elvis, as it's a nice middle-ground between traditional vi and vim. I'm not questioning the value of including an elvis package in slackware, merely whether its sensible to continue to have it as the default 'vi' given its inability to deal with the character encoding that the majority now appear to be using.
 
Old 08-08-2014, 11:11 AM   #72
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Original Poster
Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by Soderlund View Post
Some sources say that you can press Ctrl-Shift-U and enter a Unicode code point, but it doesn't work for me in the console or in X. I think it might be a GNOME or KDE thing.
On the console you can enter the unicode code point by holding down the left alt key while typing the decimal value of the unicode character on the numpad.

i.e. for the euro symbol 0x20AC(decimal 8364): leftAlt-numpad8-numpad3-numbpad6-numpad4-release_leftAlt.

Its a bit of a pain though, and only works on the console, not in X.
 
1 members found this post helpful.
Old 08-08-2014, 11:59 AM   #73
frankiej
LQ Newbie
 
Registered: Feb 2013
Distribution: Fedora
Posts: 29

Rep: Reputation: 24
Quote:
Originally Posted by Soderlund View Post
There is one thing that I haven't figured out yet: Unicode compose. Some sources say that you can press Ctrl-Shift-U and enter a Unicode code point, but it doesn't work for me in the console or in X. I think it might be a GNOME or KDE thing.
From what I have read, Ctrl-Shift-U is a GTK thing and should work in any GTK app. I can get it to work just fine in the xfce-terminal but it will not work in konsole. The only thing I could ever find for KDE is setting the compose key in the keyboard advanced settings, but that just helps with key combinations, it doesn't allow you to enter a Unicode sequence.
 
1 members found this post helpful.
Old 08-10-2014, 03:51 AM   #74
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Original Poster
Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
One annoying thing that I'd forgotten about traditional vi (which ex-vi also does), but neither elvis nor vim do, is to return to command mode when you move the cursor around when in input mode. This is going to take a bit of adjusting to.

... perhaps I'll just switch to emacs
 
Old 08-10-2014, 05:14 AM   #75
audriusk
Member
 
Registered: Mar 2011
Location: Klaipėda, Lithuania
Distribution: Slackware
Posts: 360

Rep: Reputation: 199Reputation: 199
Quote:
Originally Posted by GazL View Post
One annoying thing that I'd forgotten about traditional vi (which ex-vi also does), but neither elvis nor vim do, is to return to command mode when you move the cursor around when in input mode. This is going to take a bit of adjusting to.

... perhaps I'll just switch to emacs
If you feel the need to move while in insert mode, you're using vi inefficiently. The effective way to use it is to navigate in normal mode and type text in insert mode. This screencast demonstrates the benefits of using different modes for different tasks clearly. Answers to this Super User question also explain quite well why insert mode is best left for only inserting text.
 
  


Reply



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
locale: Cannot Set LC_ALL to default locale: No such file or directory. asym Linux - General 11 10-24-2018 05:54 PM
Locale or run level - cannot open display message konzo Linux - Newbie 5 01-14-2010 04:32 PM
How on Sarge to get adduser+locale let new user run a language root & others don't Frommacau Debian 3 06-28-2006 08:11 AM
locale: Cannot set LC_ALL to default locale: Invalid argument GadgetWiz Mandriva 1 03-31-2006 11:38 PM
Linux box calling a batch script on a windows box to run? Is it possible? joelhop Programming 8 05-17-2004 04:49 PM

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

All times are GMT -5. The time now is 07:18 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