Check for either str or unicode