always encode strings to utf-8
fix hash