try:
    import json
except ImportError:
    from django.utils import simplejson as json
    
from base import Serializer
    
class JSONSerializer(Serializer):

    def serialize(self):
        data = self.preprocess()

        return json.dumps(data)

try:
    import json
except ImportError:
    from django.utils import simplejson as json
    
from base import Serializer
    
class JSONSerializer(Serializer):

    def serialize(self):
        data = self.preprocess()

        return json.dumps(data, ensure_ascii=False)

Fix a bug that caused JSON to be serialized as a byte stream with unicode code points
Fix a bug that caused JSON to be serialized as a byte stream with unicode code points

  try:
      import json
  except ImportError:
      from django.utils import simplejson as json
      
  from base import Serializer
      
  class JSONSerializer(Serializer):
  
      def serialize(self):
          data = self.preprocess()
  
-         return json.dumps(data)
+         return json.dumps(data, ensure_ascii=False)
  
Fix a bug that caused JSON to be serialized as a byte stream with unicode code points
## Code Before:
try:
    import json
except ImportError:
    from django.utils import simplejson as json
    
from base import Serializer
    
class JSONSerializer(Serializer):

    def serialize(self):
        data = self.preprocess()

        return json.dumps(data)

## Instruction:
Fix a bug that caused JSON to be serialized as a byte stream with unicode code points
## Code After:
try:
    import json
except ImportError:
    from django.utils import simplejson as json
    
from base import Serializer
    
class JSONSerializer(Serializer):

    def serialize(self):
        data = self.preprocess()

        return json.dumps(data, ensure_ascii=False)
