From 1f8037fda12f51ec71872eba1c7e2db5b97c52b9 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 26 Oct 2025 11:58:04 +0900 Subject: [PATCH] Fix Issue #2: UTF-8 encoding error in install_qwen_lora.bat --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cc7bcb7..9364f92 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ The `NunchakuQwenImageLoraStack` node automatically adjusts the number of visibl - **Cross-Platform**: Works on Windows with batch files - **Error Handling**: Comprehensive error checking and user feedback - **Issue #1 Fixed**: Resolved [ComfyUI\custom_nodes not found error](https://github.com/ussoewwin/ComfyUI-QwenImageLoraLoader/issues/1) with improved path detection (thanks to @mcv1234's solution) +- **Issue #2 Fixed**: Fixed UTF-8 encoding error causing `SyntaxError: (unicode error)` by using PowerShell for proper UTF-8 encoding when writing to `__init__.py` ## Requirements @@ -139,7 +140,18 @@ This node is designed to work with: ## Changelog -### v1.1.0 (Latest) +### v1.2.0 (Latest) +- **Fixed [Issue #2](https://github.com/ussoewwin/ComfyUI-QwenImageLoraLoader/issues/2)**: Resolved UTF-8 encoding error that caused `SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0x90 in position 0` +- **Technical Fix**: Changed the batch file to use PowerShell for UTF-8 encoding when writing Python code to `__init__.py` +- **Root Cause**: Windows batch files write in Shift-JIS encoding by default, which causes Python to fail when reading files as UTF-8 +- **Solution**: Temporary file creation + PowerShell UTF-8 encoding ensures proper file encoding +- **Technical Details**: + - Changed from direct append (`>>`) to temp file method + - Uses PowerShell `Get-Content` and `Add-Content` with `-Encoding UTF8` parameters + - Ensures all Python code is written with proper UTF-8 encoding +- **Impact**: Installation script now works correctly without encoding errors + +### v1.1.0 - **Fixed [Issue #1](https://github.com/ussoewwin/ComfyUI-QwenImageLoraLoader/issues/1)**: Resolved "ComfyUI\custom_nodes not found" error reported by @mcv1234 - **Special Thanks**: This fix was implemented based on the excellent solution provided by @mcv1234 in the GitHub issue - **Improved Path Detection**: Replaced unreliable wildcard search with relative path detection using script directory (solution by @mcv1234)