
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
84
|
Chapter 4: Primitive Datatypes
"unity@moock.org" // A self-promotional string
"123" // It may look like a number, but it's a string
'singles' // Single quotes are acceptable too
Before we see how to form string literals, let’s examine which characters are permit-
ted in strings.
Character Encoding
Like all computer data, text characters are stored internally using a numeric code.
They are encoded for storage and decoded for display using a character set, which
maps (i.e., relates) characters to their numeric codes. Character sets vary for differ-
ent languages and alphabets. Originally, most Western applications used some deriv-
ative of ASCII, a standard character set that includes only 128 characters—the
English alphabet, numbers, basic punctuation marks, and special control characters.
In time, Western applications supported a family of character sets known collec-
tively as ISO-8859, an extension of ASCII. Each of the ISO-8859 character sets
encodes the standard Latin alphabet (A to Z), plus a varying set of letters needed in
the target languages. Flash Player 5, for example, uses ISO-8859-1, also known as
Latin 1, as its primary character map (it also supports a second character set, called
Shift-JIS, for Japanese characters).
The Latin 1 character set accommodates most Western ...