has to encode the string for non-ascii