Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 03-23-2012, 04:16 AM   #1
Registered: Oct 2009
Location: Federal Way, WA
Distribution: openSUSE 11.4 x86_64, openSuSE 12.1, Fedora 15
Posts: 207

Rep: Reputation: 34
How to insert Unicode (or extended ASCII) characters in text files?

Not sure if this question should go here or under software so I put it here. Moderator can move if desired.

I know that word processors have facilities for inserting special characters (Unicode) into documents. What I want to do is have something similar using a plain text editor like Kate or Gedit. I've tried goint the compose key route but that seems to be rather limited as to what characters can be generated.

So far I've been using cut & paste from charts but that is a PITA. Things like symbols for currency, mathematics, engineering, etc.

For example (cut & pasted) .

Thanks, Tom
Old 03-23-2012, 07:25 AM   #2
Senior Member
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
It is depended on keyboard layout rather than editor. And compose key is one of solutions, I don't think it is limited. For example € is created by "E" followed by "=", by "o" followed by "c", Œ is "O" and "E", is "o" and "s", etc. For list of possible combinations look at your /usr/share/X11/locale/en_US.UTF-8/Compose and other locales if you have. You can also configure your own combinations (look at "man Compose"), but I do not tested this.

The other methods are configure your own keyboard layout, but if you want to use many non standard characters you can stuck at too low buttons on your keyboard. But other hand you can define many layouts and easily switch between them.
Old 04-02-2012, 09:23 PM   #3
Registered: Dec 2009
Distribution: Ubuntu Karmic Koala, Slackware 13.0
Posts: 66

Rep: Reputation: 16
Also, if you know the hex code for the character you want to insert, simply go to your editor and press "CTRL + SHIFT + U". A small underlined "u" will appear, and then insert the hex code (in lower case) and then enter. For example, is "d1", is "a2", etc.
1 members found this post helpful.
Old 04-03-2012, 01:50 PM   #4
Senior Member
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 4,674

Rep: Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485Reputation: 1485
If you copy the compose file to ~/.XCompose, you can edit it and add anything you need. In fact, all the symbols you've listed are there:
I've added things like ≥, ≠, and ∅.

For things where you can't think of a combination, you can use the AltGr key. Just add the extras to your /usr/share/X11/xkb/symbols/us file:
key <AE04> {[4, dollar, sterling]};
will give from AltGr+4 instead of using Compose L-.

Last edited by DavidMcCann; 04-03-2012 at 01:55 PM.
Old 12-28-2012, 06:28 PM   #5
LQ Newbie
Registered: Jun 2012
Location: New Jersey, USA
Distribution: openSUSE 13.1
Posts: 21

Rep: Reputation: Disabled
Big thanks to Geriao.
I have searched far and wide for the answer on this issue.
So simple to do, it is brilliant.

Hey, I don't know how "relevant and timely" I might be here , but I haven't posted in some time and this here bump could help other people looking for a genius solution for posting with ASCII.


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
non-ascii characters in bash script and unicode igor.R Linux - Newbie 31 12-29-2012 04:45 AM
Extended ASCII characters on Framebuffer Console BoraxMan Linux - Desktop 3 12-12-2011 12:10 PM
using extended ascii characters sasser Linux - Newbie 2 04-06-2010 09:50 AM
bash printing extended ASCII characters nutthick Programming 6 02-04-2005 03:15 PM
Extended ASCII characters in UNIX MatSzor Programming 5 05-15-2004 10:57 PM > Forums > Linux Forums > Linux - General

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

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