Computing.Net > Forums > Linux > Linux and Alt-Characters

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Linux and Alt-Characters

Reply to Message Icon

Name: Adam
Date: December 6, 2003 at 13:23:49 Pacific
OS: Mandrake 9.2
CPU/Ram: 776MHZ/256MB
Comment:

I try to do things like Alt-0160 in Linux
on the numberpad but they don't see to
work. Can I still do these on Linux?



Sponsored Link
Ads by Google

Response Number 1
Name: 3Dave
Date: December 8, 2003 at 03:06:06 Pacific
Reply:

Yep. Not sure about under X (I think its application dependant or you have to modify the keymap) but in text mode you use the octal number for the character, eg:
charater = a
hex = 61
dec = 97
octal = 141

So you can either do:
Alt & 141
or
$ echo -e "\141"
or
$ perl -e 'print "\141\n";'
I suppose you could do the last two in an terminal under X.

Here is a c program you can use to convert decimal ascii codes into charaters. It is a bit like the DOS chr program, ($ chr 97 would return "a")

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{
char c[] = {atoi(argv[1]), '\0'};

printf("%s\n", c);

return EXIT_SUCCESS;
}


0
Reply to Message Icon

Related Posts

See More


How to install AC97 onboa... FormMail & Sendmail



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Linux Forum Home


Sponsored links

Ads by Google


Results for: Linux and Alt-Characters

New to Linux and mouse problem www.computing.net/answers/linux/new-to-linux-and-mouse-problem/27466.html

Linux and hide windows www.computing.net/answers/linux/linux-and-hide-windows/11993.html

Corel LInux and Cable modem www.computing.net/answers/linux/corel-linux-and-cable-modem/2090.html