'Returns a deep copy of the parameter, UTF-8-encoding any strings
encountered.'

@classmethod
def _utf8_encode(cls, value):

    if isinstance(value, dict):
        return {cls._utf8_encode(key): cls._utf8_encode(value) for (key, value) in value.iteritems()}
    elif isinstance(value, list):
        return [cls._utf8_encode(item) for item in value]
    elif isinstance(value, unicode):
        return value.encode('utf-8')
    else:
        return value
