fix bug reading metadata with non-ascii characters