Ascii Issue
See original GitHub issueThis is all a learning experience for me so the answer may be obvious and I am just missing it.
If I create a list as such:
LangQuestion = [
inquirer.List('lang',
message="Select Language",
choices=['English', 'Français', 'Deutsche'],
),# ç
]
answers = inquirer.prompt(LangQuestion)
pprint(answers)
It breaks due to UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 4: ordinal not in range(128)
However anywhere else in my project where I reference Français and does not involve using inquirer it works fine. Is there a way to expand the ascii to accommodate such characters? I thought UTF-8 would cover all of it to begin with but again this is outside of my realm of knowledge.
Thank you for your time!
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
What is a problem with using ASCII? - Quora
The problem with ASCII is that it only supports letters from basic English (Latin-1) alphabet. So whenever you want to use a non-English...
Read more >ASCII | Definition, History, Trivia, & Facts | Britannica
ASCII, in full American Standard Code for Information Interchange, a standard data-encoding format for electronic communication between computers.
Read more >Be careful with ASCII issue when working with text - Medium
Be careful with ASCII issue when working with text. Today I encountered a weird bug, which I later found out relating to ASCII...
Read more >ASCII char issue in UTF-8 - Oracle Communities
Hi, I am using XML with UTF-8 character encoding, there is a customer name which is in chinese char coming from DB is...
Read more >Ascii character Issue in Oracle Database - sql - Stack Overflow
I have a problem about running sql script in Oracle Sql Developer. There is an issue regarding invalid character. How can I fix...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You are right, but this problem only happens in python 2, and it has a year and a half life time. In addition, Inquirer is about user’s input. So I think this is Inquirer responsibility. Anyway, this makes it easy for any developer to use Inquirer, even more if they use the JSON configuration format.
I think this solution is “good enough”. Maybe it is not the best one, but will work in most common cases.
Hmm looking at your solution, I would quiet object that it is a good one. I don’t think library should do such operations, it should be the user’s responsibility to provide valid input, which in this case means properly decoded strings in case of Python 2. What if for example, somebody would use a different encoding, I know that in these days it is not really common to use something else then UTF-8, but it is a possibility…
But it is your call 😉