As of new MessagePack specification, MessagePack specified Unicode string handling. This document describes MsgPack-CLI design and implementation for it.
Previously, the defacto-standard interpretation of MessagePack specification is Unicode string should be encoded UTF-8 without BOM and stores as Raw type. So, MsgPack-CLI is implemented as following:
- Packer packs String (or Char sequence) as UTF-8 bytes on Raw type. Note that Packer provides overloaded methods which accepts System.Text.Encoding to specify custom character encoding.
- Unpacker and MessagePackObject handles Raw type value as Byte[], and they provides ReadString or AsString method which handles character decoding from unpacked Raw type value.
- MessagePackSerializer uses above primitive API as following rules: