only encode if unicode