fix verify function with non-native charsets