Communication encoding bug fixed, all converted to UTF-8.

This commit is contained in:
戒酒的李白
2025-08-24 15:41:58 +08:00
parent 29dbc76044
commit 5d49063b26
5 changed files with 170 additions and 14 deletions

View File

@@ -8,6 +8,20 @@ import sys
import streamlit as st
from datetime import datetime
import json
import locale
# 设置UTF-8编码环境
os.environ['PYTHONIOENCODING'] = 'utf-8'
os.environ['PYTHONUTF8'] = '1'
# 设置系统编码
try:
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
except locale.Error:
try:
locale.setlocale(locale.LC_ALL, 'C.UTF-8')
except locale.Error:
pass
# 添加src目录到Python路径
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))

View File

@@ -8,6 +8,20 @@ import sys
import streamlit as st
from datetime import datetime
import json
import locale
# 设置UTF-8编码环境
os.environ['PYTHONIOENCODING'] = 'utf-8'
os.environ['PYTHONUTF8'] = '1'
# 设置系统编码
try:
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
except locale.Error:
try:
locale.setlocale(locale.LC_ALL, 'C.UTF-8')
except locale.Error:
pass
# 添加src目录到Python路径
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))

View File

@@ -8,6 +8,20 @@ import sys
import streamlit as st
from datetime import datetime
import json
import locale
# 设置UTF-8编码环境
os.environ['PYTHONIOENCODING'] = 'utf-8'
os.environ['PYTHONUTF8'] = '1'
# 设置系统编码
try:
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
except locale.Error:
try:
locale.setlocale(locale.LC_ALL, 'C.UTF-8')
except locale.Error:
pass
# 添加src目录到Python路径
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))