Fixed issue with char encoding in serialization