Linked Questions
24 questions linked to/from Python Unicode Encode Error
0 votes
0 answers
1k views
BeautifulSoup UnicodeEncodeError: ascii codec [duplicate]
I'm trying to do some parsing with BeautifulSoup: from bs4 import BeautifulSoup import requests import lxml r = requests.get('https://pythonprogramming.net/parsememcparseface/') page_text = r.text....
0 votes
1 answer
212 views
Scala API with encode special character not working for client [duplicate]
We have this function which takes care of special character. For example this function will convert He shouldn’t be allowed to He shouldn�t be allowed. import io.circe._, io.circe.generic.auto._, io....
14 votes
2 answers
29k views
Python: Sanitize a string for unicode? [duplicate]
Possible Duplicate: Python UnicodeDecodeError - Am I misunderstanding encode? I have a string that I'm trying to make safe for the unicode() function: >>> s = " foo “bar bar ” weasel" &...
17 votes
2 answers
35k views
Selenium webdriver and unicode
It's my 2nd day with Selenium 2 library and the pain with Unicode never seem to subside. I'm just doing the most basic operation, want to print the page source: from selenium import webdriver driver ...
2 votes
5 answers
5k views
Python: Can't write to file - UnicodeEncodeError
This code should write some text to file. When I'm trying to write my text to console, everything works. But when I try to write the text into the file, I get UnicodeEncodeError. I know, that this is ...
7 votes
2 answers
2k views
Why python 2.7 on Windows need a space before unicode character when print?
I use cmd Windows, chcp 65001, this is my code: print u'\u0110 \u0110' + '\n' Result: (a character cmd can't display) (character what i want) Traceback (most recent call last): File "b.py", ...
3 votes
1 answer
5k views
Python strings and str() method encoding and decoding
I see that the Python manual mentions .encode() and .decode() string methods. Playing around on the Python CLI I see that I can create unicode strings u'hello' with a different datatype than a '...
2 votes
1 answer
5k views
python 'ascii' codec can't encode character
I keep getting an error when trying to display content from an rss feed. the feeds I have tried are the Teksyndicate "kitchen sink" feed(utf-8) and the AMD news feed(encoding not set), both downloaded ...
1 vote
1 answer
2k views
UnicodeEncodeError, can't seem to set errors='ignore'
I'm fairly new to Python, so I'm hoping this is something simple that I'm just missing. I'm running Python 2.7 on Windows 7 I'm trying to run a basic twitter scraping program through the command ...
0 votes
2 answers
2k views
pandas dataframe and u'\u2019'
I have a pandas dataframe (python 2.7) containing a u'\u2019' that does not let me extract as csv my result. UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 180: ...
2 votes
1 answer
2k views
Unicode Encoding Errors Python - Parsing XML can't encode a character (Star)
I am a beginner to Python and am currently parsing a web-based XML file from the eventful.com API however, I am receiving some unicode errors when retrieving certain elements of the data. I am able ...
-2 votes
2 answers
2k views
Chinese word, UnicodeEncodeError: 'ascii' codec can't encode characters in position 55-56: ordinal not in range(128)
#python 3 version ... #關於產地 ... crop = '牛蒡' ... #要求輸入資料 def rundatainputcircle(): marketinput = input('*請擇一輸入: 1:台北一, 2:台北二, 3:三重市, 4:台中市, 5:高雄市, 6:鳳山市, 7:桃園縣 或是不填寫 > ') if ...
2 votes
1 answer
922 views
"cannot find the input table or query" error for a SELECT statement
I am saving MS Access tables as CSV files using Python. There is a table in the MS Access database that is named 'Perm_Site Info'. There is a space in the naming in MS Access. When I run the below ...
3 votes
1 answer
1k views
Parsing Stackoverflow Posts.xml data dump file crashes the program, gives ascii encoding error
I have downloaded Stackoverflow June 2013 data dump and now in the process of parsing the XML files and storing in MySQL database. I am using Python ElementTree to do it and it keeps crashing and ...
0 votes
1 answer
1k views
PyInstaller codecs issues
Working on Ubuntu 16.04, python 2.7.12, I have this code (codec.py): #!usr/bin/env python # -*- coding: utf-8 -*- import codecs text = u'pi: \u03c0' print text Start program with: python codec.py ...