Help Center> FunctionGraph> FAQ> Trigger Management FAQs> What If Garbled Characters Are Reported for Chinese Comments in Python Functions?

What If Garbled Characters Are Reported for Chinese Comments in Python Functions?

When you use Python to edit code online and need to output Chinese, add the following code to the editor:
# -*- coding:utf-8 -*-
import json
def handler (event, context):
output = 'Hello message: ' + json.dumps(event,ensure_ascii=False)
return output