Response to Encoding Information

Ziva Xu
2 min readFeb 5, 2018
  • What are the three primary encoding schemes used to represent Unicode characters in a computer, and how do they differ from each other? Which do you think would be the most efficient in terms of space, and which would be the easiest to work with in code?

The three primary encoding schemes are: UTF-32, UTF-16 and UTF-8. Those three encoding schemes all code Unicode code points but using different number of bits — UTF-32 uses 32 bits (4 bytes per character), while UTF-16 uses at least 2 bytes and UTF-8 uses at least 1 byte as variable-length encodings. Furthermore, UTF-8 is binary compatible with ASCII (except bytes 12–17), while a lot of languages like Javascript has UTF-16 encoded strings.

In terms of space efficiency, it is hard to determine whether UTF-8 or UTF-16 is better. When signal bytes are used quite often, UTF-8 wastes a lot of space. However, these days UTF-8 is considered as relatively space efficient for the majority of use cases.

In terms of easiness to work with in code, UTF-32 is considered as the best. This is because it always uses 4 bytes per character, which is simple and easy for systems to interpret.

  • Images are stored and manipulated in a computer using either a raster or vector encoding: what’s the difference between the two encoding methods? Which sort of images are best for raster encoding, and which sort of images are best for vector encoding?

Raster images are made of pixels, which are single points or the smallest single elements in a display device. When they are enlarged out of their dimensions, they lose quality.

Vector images, on the other hand, are mathematical calculations from one point to another that form lines and shapes. Vector images are resolution-independent, which means the shapes (objects) in vector images can be scaled and printed at any size without losing quality.

Raster images are more common in general such as jpg, gif, png, and are widely used on the web. They represent and edit photographs and photo-like images better than vector programs because they can use an abundant number of different color pixels. They are also better at creating color blends thn vector graphics.

Vector graphics are common for images that will be applied onto a physical product. They are usually used for logos, illustrations, technical drawings and for use with processes that require vector art such as specialty signs and printing, engraving and etching. They are also used in CAD, Engineering, and 3D graphics.

--

--