Better string encoding