fix: add UTF-8 encoding wrapper for Windows compatibility (#61)
Fixes UnicodeEncodeError when running search.py on Windows systems with cp1252 encoding (default Windows terminal encoding). The CSV data files contain Unicode symbols (✓, ⚡, ⚠, etc.) that cannot be encoded in cp1252, causing the script to crash. Closes #22
This commit is contained in:
@@ -8,6 +8,14 @@ Domains: style, prompt, color, chart, landing, product, ux, typography
|
|||||||
Stacks: html-tailwind, react, nextjs
|
Stacks: html-tailwind, react, nextjs
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import io
|
||||||
|
|
||||||
|
# Fix UnicodeEncodeError on Windows (cp1252 doesn't support Unicode symbols)
|
||||||
|
# See: https://github.com/nextlevelbuilder/ui-ux-pro-max-skill/issues/22
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, search, search_stack
|
from core import CSV_CONFIG, AVAILABLE_STACKS, MAX_RESULTS, search, search_stack
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user