from rest_framework.renderers import JSONRenderer


class UnicodeJSONRenderer(JSONRenderer):
    charset = "utf-8"

    def get_indent(self, accepted_media_type, renderer_context):
        return 2  # 可选：设置缩进

    def render(self, data, accepted_media_type=None, renderer_context=None):
        return super().render(data, accepted_media_type, renderer_context)
