We help IT Professionals succeed at work.

How to find the Unix Ascii code for a letter like o ?

Richard Coffre
on
Medium Priority
395 Views
Last Modified: 2013-12-27
How to find the Unix Ascii code for a letter like o ?
And how do I write it in a file ? \<ascii code> ?
Comment
Watch Question

Commented:
"man ascii" will give you the ASCII character set.

You can write it in a file with "echo o > file". That puts the single character 'o' in a file, with the character represented by its ASCII code. Or do you have something else in mind?
Richard Coffree-commerce Product Manager

Author

Commented:
When I use "man ascii", I don't have special characters like a, o, ...
So what is the solution for these characters ?
Commented:
Sorry, I'm a little slow. The special characters look like ordinary 'a' and 'o' on my browser. You must mean characters with accents, umlauts, or grave marks.

Those characters are not in the ASCII set. (It is the "American Standard Code for Information Interchange", so the supported alphabet is the 26 letter English alphabet.)

So you can't represent them as ASCII. You have to use a different character set, such as ISO 8859. You enter those in a file using vi by (in insert mode) pressing Ctrl-V and entering the decimal code for the character.

http://czyborra.com/charsets/iso8859.html discusses many character sets.

You might also look at man locale for information about configuring your system for a specific character set.
Richard Coffree-commerce Product Manager

Author

Commented:
Thanks a lot.
It's perfect

Explore More ContentExplore courses, solutions, and other research materials related to this topic.