Skip to content

知了 Cicada · 任何会议和直播的实时字幕、同声传译、AI 会议纪要,Mac、Windows、Linux、Android 免费开源。Live subtitles, interpreting and meeting notes for any call or stream, on Mac, Windows, Linux and Android.

build: the Windows and Android string checks print Chinese keys instead of crashing on a cp1252 console

wquguru9f1c68db3b5d
diff --git a/android/scripts/strings.py b/android/scripts/strings.py
index 3e7e168..4cb146a 100755
--- a/android/scripts/strings.py
+++ b/android/scripts/strings.py
@@ -4,6 +4,8 @@ android/core that is in neither the Mac's Resources/<lang>.lproj/Localizable.str
android/app/src/main/strings/<lang>.lproj/Android.strings. --write appends the missing keys to
Android.strings as TODO lines (value = the Chinese)."""
import re, sys, pathlib
+# The Windows console is cp1252: Chinese keys would crash the report itself.
+sys.stdout.reconfigure(encoding="utf-8")
here = pathlib.Path(__file__).resolve().parent.parent
root = here.parent
keys = []
diff --git a/windows/scripts/strings.py b/windows/scripts/strings.py
index ff46076..03fc22e 100755
--- a/windows/scripts/strings.py
+++ b/windows/scripts/strings.py
@@ -3,6 +3,8 @@
neither the Mac's Resources/<lang>.lproj/Localizable.strings nor windows/src/Cicada/Strings/<lang>.lproj/Windows.strings.
--write appends the missing keys to Windows.strings as TODO lines (value = the Chinese)."""
import re, sys, pathlib
+# The Windows console is cp1252: Chinese keys would crash the report itself.
+sys.stdout.reconfigure(encoding="utf-8")
win = pathlib.Path(__file__).resolve().parent.parent
root = win.parent
keys = []