diff --git a/check_encodings.py b/check_encodings.py new file mode 100644 index 00000000..070ad656 --- /dev/null +++ b/check_encodings.py @@ -0,0 +1,24 @@ + +import os + +def check_encoding(directory): + for root, dirs, files in os.walk(directory): + for file in files: + if file.endswith('.uvue') or file.endswith('.uts'): + filepath = os.path.join(root, file) + try: + with open(filepath, 'rb') as f: + raw = f.read() + + # Check for BOM + if raw.startswith(b'\xef\xbb\xbf'): + print(f"BOM detected: {filepath}") + + # Try decoding as UTF-8 + raw.decode('utf-8') + + except Exception as e: + print(f"Potential encoding error or mojibake in: {filepath}") + +check_encoding(r'd:\骅锋\mall\pages\mall\admin') +check_encoding(r'd:\骅锋\mall\layouts') diff --git a/check_file_tags.py b/check_file_tags.py new file mode 100644 index 00000000..c4796ba4 --- /dev/null +++ b/check_file_tags.py @@ -0,0 +1,56 @@ +import sys +import re + +def check_file(file_path): + print(f"Checking {file_path}") + try: + with open(file_path, 'r', encoding='utf-8') as f: + content = f.read() + + tags = ['template', 'script', 'style', 'view', 'text', 'image', 'scroll-view', 'input', 'textarea', 'button', 'swiper', 'swiper-item', 'component', 'slot'] + + for tag in tags: + # Count open tags: or + # Avoid matching diff --git a/pages/mall/admin/distribution/setting/index.uvue b/pages/mall/admin/distribution/setting/index.uvue index 89a1d864..b73af0fb 100644 --- a/pages/mall/admin/distribution/setting/index.uvue +++ b/pages/mall/admin/distribution/setting/index.uvue @@ -1,4 +1,4 @@ -