'Encode anything that is unicode-ish as utf-8.  This method is only
called for Py3+.'

@staticmethod
def _encode_str(value):

    if isinstance(value, str):
        value = value.encode(u'utf-8')
    elif (isinstance(value, bytes) or (value is np.ma.masked)):
        pass
    else:
        value = np.asarray(value)
        if (value.dtype.char == u'U'):
            value = np.char.encode(value, encoding=u'utf-8')
    return value
