              return ''
          return super(CharField, self).run_validation(data)
  
      def to_internal_value(self, data):
          return six.text_type(data)
  
      def to_representation(self, value):
          return six.text_type(value)
  
  
 
</s> remove         return six.text_type(value)
 </s> add         representation = six.text_type(value)

        if self.trim_whitespace:
            return representation.strip()

        return representation
        value = six.text_type(data)

        if self.trim_whitespace:
            return value.strip()

        return value
              return ''
          return super(CharField, self).run_validation(data)
  
      def to_internal_value(self, data):
        value = six.text_type(data)

        if self.trim_whitespace:
            return value.strip()

        return value
  
      def to_representation(self, value):
          return six.text_type(value)
  
  
keep keep keep keep replace keep 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