Skip to content

Commit

Permalink
修复 腾讯云函数 无法读取 中文的问题(即提前编译好)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zkeq committed Feb 21, 2022
1 parent 7fa2de5 commit 42dae1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python-CLI/main_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def read_json(file_name):

# 写入json文件
def write_json(file_name, _data):
for i in _data:
_data[i] = urllib.parse.quote(_data[i], safe='/:?=&%20')
with open(file_name, 'w+', encoding='utf-8') as f:
json.dump(_data, f, indent=2, ensure_ascii=False)

Expand Down
2 changes: 2 additions & 0 deletions python-CLI/main_oss_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ def read_json(file_name):

# 写入json文件
def write_json(file_name, _data):
for i in _data:
_data[i] = urllib.parse.quote(_data[i], safe='/:?=&%20')
with open(file_name, 'w+', encoding='utf-8') as f:
json.dump(_data, f, indent=2, ensure_ascii=False)
bucket.put_object_from_file(file_name, file_name)
Expand Down

1 comment on commit 42dae1b

@vercel
Copy link

@vercel vercel bot commented on 42dae1b Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

Please sign in to comment.