O'Reilly logo

Unicode Demystified by Richard Gillam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mapping Single Characters to Other Values

Testing a character for membership in a class is really just a special case of mapping from a single character to a single value—in essence, you're mapping from a character (or, more accurately, a code unit) to a Boolean value. Most of the time, however, you want to map to something with more possible values than a Boolean value. For example, instead of checking whether a character is a member of some class, you may want to perform one operation to see which of several mutually exclusive classes a given character belongs to (as opposed to checking each category one by one for the character, as you might have to do if the categories overlapped). There are plenty of other uses for this kind of thing: mapping ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required