From fa4163b963dcd998af256dd55fa3bf6881557325 Mon Sep 17 00:00:00 2001 From: Li <429525481@qq.com> Date: Thu, 23 Oct 2025 14:53:20 +0800 Subject: [PATCH] fix(utility): Support downloading trading instruments with Chinese names --- python/utility.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python/utility.py b/python/utility.py index 72d3ee6..588e459 100644 --- a/python/utility.py +++ b/python/utility.py @@ -3,6 +3,7 @@ from pathlib import Path from datetime import * import urllib.request +from urllib.parse import quote from argparse import ArgumentParser, RawTextHelpFormatter, ArgumentTypeError from enums import * @@ -15,7 +16,9 @@ def get_destination_dir(file_url, folder=None): return os.path.join(store_directory, file_url) def get_download_url(file_url): - return "{}{}".format(BASE_URL, file_url) + # Ensure the URL is properly encoded to handle Chinese characters + encoded_url = quote(file_url, safe='/') + return "{}{}".format(BASE_URL, encoded_url) def get_all_symbols(type): if type == 'um':