This is a follow up of ArrayBuffer video from last time.
This time we use Utf-16 encoding to encode and decode characters. This answers the question about how to assign non-numerical values to a TypedArray. We simply choose an encoding for it then use String.prototype's built-in methods.
We use String.prototype.charCodeAt function to encode a character from string.
On the opposite direction, we use String.prototype.fromCharCode function to convert character code back to string.
Have a look at jsfiddle code below for demo.
Refer: https://jsfiddle.net/6audtywx/4/
Refer: http://www.fileformat.info/info/chars...