encode the index to utf-8 so that special chars work