2.1  Character Set

2.1 Character Set

The syntax of Erlang tokens allow the use of the full ISO-8859-1 (Latin-1) character set. This is noticeable in the following ways:

  • All the Latin-1 printable characters can be used and are shown without the escape backslash convention.

  • Atoms and variables can use all Latin-1 letters.

Octal Decimal Class
200 - 237 128 - 159 Control characters
240 - 277 160 - 191 - ¿ Punctuation characters
300 - 326 192 - 214 À - Ö Uppercase letters
327 215 × Punctuation character
330 - 336 216 - 222 Ø - Þ Uppercase letters
337 - 366 223 - 246 ß - ö Lowercase letters
367 247 ÷ Punctuation character
370 - 377 248 - 255 ø - ÿ Lowercase letters

Table 2.1: Character Classes

In Erlang/OTP R16B the syntax of Erlang tokens was extended to handle Unicode. The support was limited to string literals and comments. More about the usage of Unicode in Erlang source files can be found in STDLIB's User's Guide.

From Erlang/OTP 20, atoms and function names are also allowed to contain Unicode characters outside the ISO-Latin-1 range. Module names, application names, and node names are still restricted to the ISO-Latin-1 range.