From e3789952b2ef4838bb4abd323e2dacd2e65760fa Mon Sep 17 00:00:00 2001 From: D3adEr1c <102410245+D3adEr1c@users.noreply.github.com> Date: Fri, 20 May 2022 08:30:21 +0800 Subject: [PATCH] Update util.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复相同拼音不同声调会使干员图片丢失 --- draw_card/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/draw_card/util.py b/draw_card/util.py index 64fb1a9..90209e2 100644 --- a/draw_card/util.py +++ b/draw_card/util.py @@ -9,8 +9,9 @@ def cn2py(word) -> str: + """保存声调,防止出现类似方舟干员红与吽拼音相同声调不同导致红照片无法保存的问题""" temp = "" - for i in pypinyin.pinyin(word, style=pypinyin.NORMAL): + for i in pypinyin.pinyin(word, style=pypinyin.pypinyin.TONE3): temp += "".join(i) return temp