Comments (8)
Hi @sepandhaghighi, I am using gitbash (mingw64)
from art.
Interesting... thanks for the feedback, looking forward to the future release
from art.
@Pyroseza Hi
Would you please give us more information about your environment(CMD
,PowerShell
and ...)?
from art.
It seems git bash
does not support all 1-Line arts.
We will filter Non-ASCII arts for rand
mode in a future release
from art.
Hi there, I’ve just done some reading up and found that mingw does not start up in UTF-8 but it can be both configured in the settings and it can be configured in memory for the current session using an environment variable LANG='C.UTF-8'
My suggestion is to set this variable if it is not set, then output the characters, I don’t know if this will work for sure but more can be seen here: https://stackoverflow.com/a/36692549
I’ll be testing this shortly and confirm if it works or not, if not I will do a little more research on my side.
from art.
So bad news that did not work for me, looks like mingw64 (a.k.a. git bash) does not play nice when outputting unicode chars. I did confirm that it works great in powershell.
from art.
I found a solution but not the preferred solutio, it seems to be the way that python is launched without a UTF-8 encoding for IO, it launches windows' 'cp-1252'.
I found that if I set this particular environment variable PYTHONIOENCODING=utf-8
before running my script it works perfectly, if I try set it inside the script it does not work at all.
Here is my proof it works:
$ PYTHONIOENCODING=utf-8 py.exe -3 aprint.py
\(◑д◐)>∠(◑д◐)
$ PYTHONIOENCODING=utf-8 py.exe -3 aprint.py
(ᾢȍˬȍ)ᾢ ļ ļ ļ ļ ļ
This is where I found the solution:
https://stackoverflow.com/questions/4374455/how-to-set-sys-stdout-encoding-in-python-3
I still think there must be a way to set this programmatically from your lib... I'm sure of it, or at least something similar...
from art.
@Pyroseza
Thanks for your effort.
Changing PYTHONIOENCODING
environment variable is not a stable solution, because it may effect other programs and also is not applicable in all environments.
I think the best solution is filtering Non-ASCII 1-line arts for rand
mode.
from art.
Related Issues (20)
- megacooltext.com HOT 1
- Art
- console_scripts entry point
- text2art is not defined HOT 3
- `space` not working for some fonts HOT 4
- capitalizemytitle HOT 1
- Design
- Is there an ANSI version of this awesome program? HOT 1
- Print art name in random mode
- Support `space` in `art` and `aprint` functions
- adding colors HOT 4
- Ambiguous variable name 'l'
- Add ANSI-FIGlet fonts
- Add AOL-Macro fonts
- Drop support for EOL Python
- Brb HOT 1
- font_size_splitter bug HOT 3
- Release instructions
- Python 3.12 support
- Making the Project Kid-Friendly? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from art.