Fixed a bug when metadata includes unicode.