Fixed a bug with the serialization of multi-byte characters

Signed-off-by: Ozan Turgut <ozanturgut@gmail.com>