  
      def __init__(self, **kwargs):
          self.allow_blank = kwargs.pop('allow_blank', False)
          max_length = kwargs.pop('max_length', None)
          min_length = kwargs.pop('min_length', None)
          super(CharField, self).__init__(**kwargs)
          if max_length is not None:
 
</s> remove         return six.text_type(value)
 </s> add         representation = six.text_type(value)

        if self.trim_whitespace:
            return representation.strip()

        return representation </s> remove         return six.text_type(data)
 </s> add         value = six.text_type(data)

        if self.trim_whitespace:
            return value.strip()

        return value
        self.trim_whitespace = kwargs.pop('trim_whitespace', True)
  
      def __init__(self, **kwargs):
          self.allow_blank = kwargs.pop('allow_blank', False)
        self.trim_whitespace = kwargs.pop('trim_whitespace', True)
          max_length = kwargs.pop('max_length', None)
          min_length = kwargs.pop('min_length', None)
          super(CharField, self).__init__(**kwargs)
          if max_length is not None:
keep keep add keep keep keep keep
 Add trim_whitespace to CharField #2517

If set to `True` then leading and trailing
whitespace is trimmed. Defaults to `True`. 
rest_framework/fields.py