Skip to content

Fix UnicodeEncodeError in build.sh Python print statements for Windows Japanese locale - #202

Merged
harumaki4649 merged 2 commits into
mainfrom
copilot/fix-build-script-test-error
Dec 6, 2025
Merged

harumaki4649 merged 2 commits into
mainfrom
copilot/fix-build-script-test-error

Conversation

Copilot AI commented Dec 6, 2025 •

Copy link
Copy Markdown
Contributor

On Windows with Japanese locale (cp932 encoding), the python -c test commands in build.sh fail with UnicodeEncodeError when printing the ✅ emoji character.

Changes

  • Replace ✅ with [OK] in Python print statements within python -c commands
  • Affected files:
    • dictsqlite_v2/dictsqlite/build.sh
    • others/beta-versions/dictsqlite_v4/build.sh
    • others/beta-versions/dictsqlite_v4.1/build.sh
    • others/beta-versions/dictsqlite_v4.2/build.sh

Before

python -c "from dictsqlite import DictSQLiteV4; print('✅ DictSQLiteV4 imported successfully')"
# UnicodeEncodeError: 'cp932' codec can't encode character '\u2705'

After

python -c "from dictsqlite import DictSQLiteV4; print('[OK] DictSQLiteV4 imported successfully')"

Note: Bash echo statements retain emojis as they handle encoding differently from Python's print().

Original prompt

This section details on the original issue you should resolve

<issue_title>dictsqlite_v2のbuild.shで、windows10の日本語環境でビルド後にinstallを選択した際のtest errorについて</issue_title>
<issue_description>build.shのこのpython -cで問題が発生しています。

    # In local environment, ask user
    read -p "Install the built package? (y/N): " -n 1 -r
    echo
    if [[ $REPLY =~ ^[Yy]$ ]]; then
        echo "📥 Installing..."
        if compgen -G "target/wheels/*.whl" > /dev/null; then
            pip install --force-reinstall target/wheels/*.whl
            echo "✅ Installed successfully!"
        else
            echo "⚠️  No wheel found to install. Skipping installation."
        fi
        echo ""
        echo "Test installation:"
        python -c "from dictsqlite import DictSQLiteV4; print('✅ DictSQLiteV4 imported successfully')"
    fi
fi

エラー内容

✅ Installed successfully!

Test installation:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
UnicodeEncodeError: 'cp932' codec can't encode character '\u2705' in position 0: illegal multibyte sequence

Press Enter to exit...
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI self-assigned this Dec 6, 2025
…ython print statements

Co-authored-by: harumaki4649 <83683593+harumaki4649@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix test error in install process for dictsqlite_v2 Fix UnicodeEncodeError in build.sh Python print statements for Windows Japanese locale Dec 6, 2025
Copilot AI requested a review from harumaki4649 December 6, 2025 05:16
@github-actions

github-actions Bot commented Dec 6, 2025 •

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@harumaki4649
harumaki4649 merged commit 4a5db5c into main Dec 6, 2025
56 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a UnicodeEncodeError that occurs on Windows systems with Japanese locale (cp932 encoding) when running the build.sh scripts. The error was triggered by emoji characters in Python print statements that cannot be encoded by the cp932 codec.

Key Changes:

  • Replace ✅ emoji with [OK] text in Python print statements within python -c commands
  • Bash echo statements correctly retain emojis (which handle encoding differently)
  • Applied consistently across all four affected build.sh files

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
dictsqlite_v2/dictsqlite/build.sh Updated Python print statements to use [OK] instead of emoji in both CI and local installation verification tests
others/beta-versions/dictsqlite_v4/build.sh Updated local installation test to use [OK] instead of emoji
others/beta-versions/dictsqlite_v4.1/build.sh Updated local installation test to use [OK] instead of emoji
others/beta-versions/dictsqlite_v4.2/build.sh Updated Python print statements to use [OK] instead of emoji in both CI and local installation verification tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants