Linked Questions
143 questions linked to/from Python, Unicode, and the Windows console
190
votes
6
answers
575k
views
UnicodeEncodeError: 'charmap' codec can't encode - character maps to <undefined>, print function [duplicate]
I am writing a Python 3.3 program to send some data to a webpage using POST method. Mostly for debugging process I am getting the page result and displaying it on the screen using print() function.
...
26
votes
2
answers
22k
views
What's the deal with Python 3.4, Unicode, different languages and Windows? [duplicate]
Happy examples:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
czech = u'Leoš Janáček'.encode("utf-8")
print(czech)
pl = u'Zdzisław Beksiński'.encode("utf-8")
print(pl)
jp = u'リング 山村 貞子'.encode("...
24
votes
4
answers
30k
views
Python 3 print() function with Farsi/Arabic characters [duplicate]
I simplified my code for better understanding.
here is the problem :
case 1:
# -*- coding: utf-8 -*-
text = "چرا کار نمیکنی؟" # also using u"...." results the same
print(text)
output:
...
14
votes
5
answers
19k
views
How to print a unicode string in python in Windows console [duplicate]
I'm working on a python application that can print text in multiple languages to the console in multiple platforms.
The program works well on all UNIX platforms, but in windows there are errors ...
7
votes
3
answers
33k
views
python 2.7 character \u2013 [duplicate]
I have following code:
# -*- coding: utf-8 -*-
print u"William Burges (1827–81) was an English architect and designer."
When I try to run it from cmd. I get following message:
Traceback (most ...
6
votes
2
answers
3k
views
Python: Emit some Utf-8 string to windows console [duplicate]
Possible Duplicate:
Python, Unicode, and the Windows console
I read some strings from file and when I try to print these utf-8 strings in windows console, I get error
UnicodeDecodeError: 'ascii' ...
3
votes
2
answers
2k
views
Python os.walk and japanese filename crash [duplicate]
Possible Duplicate:
Python, Unicode, and the Windows console
I have a folder with a filename "01 - ナナナン塊.txt"
I open python at the interactive prompt in the same folder as the file and attempt to ...
1
vote
1
answer
2k
views
Unicode output in Python's stdout when running from cmd.exe [duplicate]
I am running Windows 7 and its console has been configured to use Consolas font, which gives me a possibility of Unicode output. The ability to read Unicode in console has been proved by me many times ...
1
vote
2
answers
3k
views
I am not able to print Arabic characters to the terminal in vscode [duplicate]
I am trying to get what a person says in Arabic and then print that to the terminal.
When I try to speak to the mic, any Arabic word I say gets printed as ???? with the number of question marks ...
0
votes
1
answer
3k
views
Print an arabic unicode string in Python(x,y) [duplicate]
I have an Arabic unicode string that I want to print in Python (using Python(x,y) on Windows 7), but I can't get it to print, only the unicode representation is printed out.
The string is defined as:
...
1
vote
0
answers
2k
views
How to resolve json.load encoding error in python? [duplicate]
I'm trying to convert a JSON text file into a python object (and also print the text to the console) I'm getting an error to do with encoding characters.
I'm using Python 3.6.5 and Windows Powershell ...
0
votes
1
answer
681
views
ElementTree and UnicodeEncodeError: [duplicate]
I'm processing the following xml file:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<tag>…</tag>
Just like python documentation says:
import xml.etree.cElementTree as ET
...
0
votes
2
answers
846
views
Can't display Chinese characters in Python when reading a JSON file with UTF-8 encoding, any solutions? [duplicate]
I am working on a json file with Chinese words in it. I try to read it in my machine with Python, but the Chinese characters just can't be correctly displayed. Here is the json file(a.json):
{
"...
0
votes
1
answer
821
views
Python: UTF-8 Encoding for € Symbol [duplicate]
I used Python2.7 to do this but I always got the same error when I try to insert the '€' symbol in my code.
My OS system is windows 10.
When I run this code:
dic = {
'\\' : b'\xe2\x95\x9a',
'-' : b'...
0
votes
1
answer
503
views
How can I solve Python Unicode Encoding Error? [duplicate]
I was trying to load a .json file. This file is an English word dictionary that contained a lot of Unicode like \u266f. By using encoding = "utf8" can not solve the error. Then I replaced all of the ...