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 Multiple Values

Compact arrays are still basically just that—arrays to which compression and indexing have been applied. Like regular arrays, they are best suited to storing values that are all the same size. They also work best when the values being mapped to are relatively small; a big array of 32-byte values, for example, can become quite unwieldy.

But what if you're looking up a value that is large, or could be of variable length? A couple of techniques can be used.

If the total universe of values that can be mapped to is relatively small, you can save space without imposing too huge a performance penalty by offloading the target values into a separate array (or other data structure). The target values in the ...

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