win-unicode-console is a Python library (current version 0.5) designed to enable proper Unicode input and output within the Windows console for Python versions up to 3.5. It addresses historical encoding issues when running Python scripts directly in the Windows console, allowing for correct display and handling of non-ASCII characters. The library is considered to be in maintenance mode, as Python 3.6 and newer versions have resolved the underlying console encoding issues via PEP 528.
pip install win-unicode-consoleVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to enable Unicode support and then print and (for Python 3) read Unicode text in the Windows console. It's crucial to call `win_unicode_console.enable()` early in your script. Ensure your console font (e.g., Lucida Console) supports the characters you wish to display.
Remove `win-unicode-console` from your dependencies for projects targeting Python 3.6 or later.
Right-click the console window title bar, select 'Properties' or 'Defaults', navigate to the 'Font' tab, and choose a Unicode-capable font like 'Lucida Console' or 'Consolas'.
Migrate to the new `streams.enable` or `streams.enable_only` interface, passing stream objects as keyword arguments (e.g., `streams.enable_only(stdin=streams.stdin_text_transcoding)`). For generic use, `win_unicode_console.enable()` should suffice.
Rely on `win_unicode_console.enable()` rather than `chcp 65001` for Unicode support in Python scripts. If you encounter issues, consider using `PYTHONIOENCODING=utf-8` as an environment variable, but be aware of its own potential caveats.
Install and call `win_unicode_console.enable()` at the beginning of your script. Additionally, ensure your console font supports the required Unicode characters.
Make sure `win_unicode_console.enable()` is called. Then, change your console font to 'Lucida Console' or 'Consolas' through the console window's properties to ensure full Unicode glyph support.
Review the `win-unicode-console` README for specific `runner` usage (e.g., `py -i -m run` for interactive mode). For Python 2, if `raw_input` issues persist with Unicode, you might need `win_unicode_console.enable(raw_input__return_unicode=False)` if your IPython version is older than 4.
No dependency data recorded yet.