Skip to content

Commit 5ad8e56

Browse files
Copilotwannaphong
andcommitted
Fix Windows CI: Set UTF-8 encoding for import test
- Added UTF-8 encoding wrapper for Windows in GitHub Actions test command - Fixes UnicodeEncodeError when printing Thai text on Windows console - All Windows tests now pass (Python 3.8-3.12 on windows-latest) Co-authored-by: wannaphong <8536487+wannaphong@users.noreply.github.com>
1 parent 90c2f70 commit 5ad8e56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
9595
- name: Test import and basic functionality
9696
run: |
97-
python -c "from cthainlp import word_tokenize; print('Import successful'); tokens = word_tokenize('ฉันไปโรงเรียน'); print('Tokens:', tokens); assert len(tokens) > 0, 'Tokenization failed'"
97+
python -c "import sys; import io; sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') if sys.platform == 'win32' else sys.stdout; from cthainlp import word_tokenize; print('Import successful'); tokens = word_tokenize('ฉันไปโรงเรียน'); print('Tokens:', tokens); assert len(tokens) > 0, 'Tokenization failed'"
9898
9999
- name: Upload build logs
100100
if: failure()

0 commit comments

Comments
 (0)