Files
MemRelay/projects/8e229c96-a83b-4a02-ac40-10a0a9da444e/start-ui.ps1 必须使用 UTF-8 BOM.md
T

20 lines
824 B
Markdown

---
title: start-ui.ps1 必须使用 UTF-8 BOM
type: experience
permalink: main/projects/8e229c96-a83b-4a02-ac40-10a0a9da444e/start-ui.ps1-必须使用-utf-8-bom
stable_id: 8c8dfa80-4c11-4951-b3c6-8cb2fe907eaf
scope: project
project_id: 8e229c96-a83b-4a02-ac40-10a0a9da444e
memory_type: experience
status: active
revision: 1
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
created_at: '2026-09-23T15:01:45.459843+00:00'
updated_at: '2026-09-23T15:01:45.459899+00:00'
tags:
- powershell
- encoding
- streamlit
---
Windows 默认 powershell.exe 是 5.1,读取无 BOM 的 UTF-8 .ps1 会按系统 ANSI(中文环境常为 GBK)解码,throw 中的中文引号和括号会被拆坏,表现为 UnexpectedToken。start-ui.ps1 必须保存为 UTF-8 with BOM。验证:powershell.exe Parser.ParseFile 通过。