Sets the value of the string

        :param value:
            A unicode string
966336
def set(self, value):
        

        if not isinstance(value, str_cls):
            raise TypeError(unwrap(
                '''
                %s value must be a unicode string, not %s
                ''',
                type_name(self),
                type_name(value)
            ))

        self._unicode = value
        self.contents = value.encode(self._encoding)
        self._header = None
        if self._indefinite:
            self._indefinite = False
            self.method = 0
        if self._trailer != b'':
            self._trailer = b''
331470
def force_encoding(value, encoding='utf-8'):
    
    if not isinstance(value, (str, unicode)):
        value = str(value)
    if isinstance(value, unicode):
        value = value.encode(encoding)
    elif encoding != 'utf-8':
        value = value.decode('utf-8').encode(encoding)
    return value
378128
def compat_string(value):
        
        if isinstance(value, bytes):
            return value.decode(encoding='utf-8')
        return str(value)
779607
def set(self, value):
        

        if not isinstance(value, str_cls):
            raise TypeError(unwrap(
                '''
                %s value must be a unicode string, not %s
                ''',
                type_name(self),
                type_name(value)
            ))

        self._unicode = value
        self.contents = iri_to_uri(value)
        self._header = None
        if self._trailer != b'':
            self._trailer = b''
304170
def message(self, value):
        

        if value is not None:
            assert type(value) in (unicode, QString), \
                "'{0}' attribute: '{1}' type is not 'unicode' or 'QString'!".format("message", value)
        self.__message = value
146809
def set_condition(self, value):
        
        if value is None or not isinstance(value, str):
            raise TypeError("Condition is required and must be set to a String")
        else:
            self.__condition = value
45911
def write_var_str(self, value, encoding: str = 'utf-8'):
        
        if isinstance(value, str):
            value = value.encode(encoding)
        self.write_var_int(len(value))
        self.write_bytes(value)
1371463
def set(self, value: int):
        
        max_value = int(''.join(['1' for _ in range(self._bit_width)]), 2)

        if value > max_value:
            raise ValueError('the value {} is larger than '
                             'the maximum value {}'.format(value, max_value))

        self._value = value
        self._text_update()
1007394
def token(self, value):
        
        if value is None:
            self._token = value
            return
        if not isinstance(value, str):
            value = str(value)
        if len(value) > 256:
            raise AttributeError
        self._token = value
1212530
def set_encoding(self, value=DEFAULT_ENCODING):
        
        if self._conn.encoding != value:
            self._conn.set_client_encoding(value)
149614
def set_value(self, value):
        
        parsed_value = self._parse_value(value)
        self.value = parsed_value
717926
def make_value(self, value):
        
        # ensure any escape sequences are converted to unicode
        value = self.unicode_escape_sequence_fix(value)

        if value and value[0] in ['"', "'"]:
            return self.remove_quotes(value)

        try:
            return int(value)
        except ValueError:
            pass
        try:
            return float(value)
        except ValueError:
            pass
        if value.lower() == "true":
            return True
        if value.lower() == "false":
            return False
        if value.lower() == "none":
            return None
        return value
222936
def _unicode(value):
    
    if isinstance(value, _TO_UNICODE_TYPES):
        return value
    if not isinstance(value, bytes_type):
        raise TypeError(
            "Expected bytes, unicode, or None; got %r" % type(value)
        )
    return value.decode("utf-8")
864478
@Override
	public void setValue(StringValue value) {
		Validate.notNull(value);
		setValue(value.value, 0, value.len);
	}
739016
def data(self, value):
        
        if value is not None and not isinstance(value, unicode):
            value = value.decode('utf-8')
        self._data = value
1263215
def validate(self, value):
        
        val = value
        if isinstance(val, str):
            #FIXME: unsafe decoding
            val = unicode(value)
        val = super(String, self).validate(val)
        if not isinstance(val, unicode):
            raise ValueError("Not a string: %r" % (value, ))
        return val
310703
def set_value(self, value: datetime):
        
        assert isinstance(value, datetime)

        self.value = value