Skip to content

Character Encoding Cheat Sheet

Lance Pollard edited this page Sep 25, 2012 · 2 revisions

This is a generic guide on character encoding, just to make it a little easier to understand the basics.

Unicode

This is the best resource on Unicode: http://unicode.org/charts/.

ANSI

This is used most often to control the command-line interface.

ANSI Escape Sequences

Colors

Black         0;30
Blue          0;34
Green         0;32
Cyan          0;36
Red           0;31
Purple        0;35
Brown         0;33
Light Gray    0;37
Dark Gray     1;30
Light Blue    1;34
Light Green   1;32
Light Cyan    1;36
Light Red     1;31
Light Purple  1;35
Yellow        1;33
White         1;37

Cursor Manipulation

clearLine:        '\u001b[K'
deleteRight:      '\u001b[1P' # 1 character
deleteLeft:       '\u001b[1X' # 1 character
insertCharacter:  '\u001b[1@'
insertLine:       '\u001b[1L'
deleteLine:       '\u001b[1M'

Resources

Clone this wiki locally