from flask import Flask, jsonify
app = Flask(__name__)
DATA = {"message": {"en-us": "Hello World!", "zh-cn": "你好,世界!"}}
@app.route('/hello_ascii')
def hello_ascii():
app.json.ensure_ascii = True
return jsonify(DATA)
@app.route('/hello_no_ascii')
def hello_no_ascii():
app.json.ensure_ascii = False
return jsonify(DATA)
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000, debug=True)
JSONPath filter: $.message.zh-cn
before:
{ "message": { "en-us": "Hello World!", "zh-cn": "你好,世界!" } }after:
[ "你好,世界!" ]before:
{ "message": { "en-us": "Hello World!", "zh-cn": "你好,世界!" } }after:
[ "菴�螂ス�御ク也阜��" ]Please authenticate to join the conversation.
Released
Feedback
Bug
11 months ago

WantChane
Get notified by email when there are changes.
Released
Feedback
Bug
11 months ago

WantChane
Get notified by email when there are changes.