Juan Christian wrote:
> On Thu, Sep 11, 2014 at 5:23 PM, Peter Otten <__pete...@web.de> wrote:
>>
>>
>> You are getting an *encoding* error, so this may be triggered when you
>> are trying to print. Can you post the traceback?
>>
>> Also, what is your OS and what does
>>
>> $ python3 -c'import loc
On Thu, Sep 11, 2014 at 5:23 PM, Peter Otten <__pete...@web.de> wrote:
>
>
> You are getting an *encoding* error, so this may be triggered when you are
> trying to print. Can you post the traceback?
>
> Also, what is your OS and what does
>
> $ python3 -c'import locale; print(locale.getpreferredenc
Juan Christian wrote:
> On Thu, Sep 11, 2014 at 4:39 PM, Juan Christian
> wrote:
>>
>> Using 3.4.1
>>
>> I did try:
>>
>> self.persona_name = unicode(personaname)
>> self.persona_name = personaname.decode("utf-8")
>>
>> But didn't work!
>>
>
>
> Some of the chars that brakes the program:
>
> \
On Thu, Sep 11, 2014 at 4:39 PM, Juan Christian
wrote:
>
> Using 3.4.1
>
> I did try:
>
> self.persona_name = unicode(personaname)
> self.persona_name = personaname.decode("utf-8")
>
> But didn't work!
>
Some of the chars that brakes the program:
\u0183
\u2020
\u0361
\u0649
And many others cra
Forget to tell, sorry. I'm using Python 3.4.1
On Thu, Sep 11, 2014 at 3:53 PM, Sebastian Silva
wrote:
> Hi,
> Python 2 suffers from these kinds of issues frequently.
>
> However Python 3 does not.
>
> Now, to deal with different encodings in Python 2 you need to cast to
> unicode type, and then
I'm iterating through Steam users and friend lists.
So, my program was working good, but then I got some UnicodeEncodeError
randomly, I didn't know where was the problem, then I was checking the
names that I got from the API by hand, and then I saw users with ™, ︻デ═一,
︻芫, º³® and tons of other
Steven D'Aprano wrote:
> glyph. He shouldn't get a UnicodeDecodeError when printing. I smell a
> bug since print shouldn't be decoding anything. (At worst, it needs to
> *encode*.)
You have correctly derived the actual traceback ;)
[Robert]
> It starts to print until it hits the wonderful charac
Robert Sjoblom wrote:
> Okay, so here's a fun one. Since I'm on a japanese locale my native
> encoding is cp932. I was thinking of writing a parser for a bunch of
> text files, but I stumbled on even printing the contents due to ...
> something. I don't know what encoding the text file uses, which
On Sat, Mar 10, 2012 at 08:03:18PM -0500, Dave Angel wrote:
> There are just 256 possible characters in cp1252, and 256 in cp932.
CP932 is also known as MS-KANJI or SHIFT-JIS (actually, one of many
variants of SHIFT-JS). It is a multi-byte encoding, which means it has
far more than 256 characte
> You can "solve" the problem by pretending the input file is also cp932 when
> you open it. That way you'll get the wrong characters, but no errors.
So I tried that:
Traceback (most recent call last):
File "C:\Users\Azaz\Desktop\CK2 Map Painter\Parser\test parser.py",
line 6, in
text = alph
On 03/10/2012 06:38 PM, Robert Sjoblom wrote:
Okay, so here's a fun one. Since I'm on a japanese locale my native
encoding is cp932. I was thinking of writing a parser for a bunch of
text files, but I stumbled on even printing the contents due to ...
something. I don't know what encoding the text
Okay, so here's a fun one. Since I'm on a japanese locale my native
encoding is cp932. I was thinking of writing a parser for a bunch of
text files, but I stumbled on even printing the contents due to ...
something. I don't know what encoding the text file uses, which isn't
helping my case either (
/09, Kent Johnson wrote:
From: Kent Johnson
Subject: Re: [Tutor] UnicodeEncodeError
To: "Albert-Jan Roskam"
Cc: "tutor@python.org tutor@python.org tutor@python.org"
Date: Wednesday, November 25, 2009, 5:55 PM
On Wed, Nov 25, 2009 at 8:44 AM, Albert-Jan Roskam wrote:
Hi,
I'
On Wed, Nov 25, 2009 at 8:44 AM, Albert-Jan Roskam wrote:
> Hi,
>
> I'm parsing an xml file using elementtree, but it seems to get stuck on
> certain non-ascii characters (for example: "ê"). I'm using Python 2.4.
> Here's the relevant code fragment:
>
> # CODE:
> for element in doc.getiterator():
Albert-Jan Roskam wrote:
> # CODE:
> for element in doc.getiterator():
> try:
> m = re.match(search_text, str(element.text))
> except UnicodeEncodeError:
> raise # I want to get rid of this exception.
First, you should separate both actions done in a single statement to isolate
the
Hi,
I'm parsing an xml file using elementtree, but it seems to get stuck on certain
non-ascii characters (for example: "ê"). I'm using Python 2.4. Here's the
relevant code fragment:
# CODE:
for element in doc.getiterator():
try:
m = re.match(search_text, str(element.text))
except Unic
"Alan Gauld" wrote in message
news:h407ah$lc...@ger.gmane.org...
"Mark Tolonen" wrote
... I see you are using Python 3.1. ...
You can also use a shell that supports the full Unicode character set
such as Idle or PythonWin instead of the console.
As a matter of interest - and somewhat o
"Mark Tolonen" wrote
... I see you are using Python 3.1. ...
You can also use a shell that supports the full Unicode character set
such as Idle or PythonWin instead of the console.
As a matter of interest - and somewhat off topic - does anyone
know if there is a Python 3 (3.0 or 3.1) versi
"gpo" wrote in message
news:24554280.p...@talk.nabble.com...
I'm doing a simple excercise in reading a file, and printing each line.
However, I'm getting this error. The file is a windows txt file, ecoded
in
ANSI(ascii). I don't understand why Pythin is displaying a Unicode error.
Here i
I'm doing a simple excercise in reading a file, and printing each line.
However, I'm getting this error. The file is a windows txt file, ecoded in
ANSI(ascii). I don't understand why Pythin is displaying a Unicode error.
Here is my script:
f=open('I:\\PythonScripts\\statement.txt')
for line
On Fri, Oct 3, 2008 at 4:04 PM, Kent Johnson <[EMAIL PROTECTED]> wrote:
> I would try explicitly converting the data to latin-1 before you send
> it to the database, giving it one of the forgiving error handling
> methods I referred to earlier. Or, change your database to UTF-8...
BTW to create a
On Fri, Oct 3, 2008 at 2:39 PM, Rob Sutherland <[EMAIL PROTECTED]> wrote:
> On Fri, Oct 3, 2008 at 12:23 PM, Kent Johnson <[EMAIL PROTECTED]> wrote:
>
>> It helps if you show the code that is causing the error and the full
>> traceback. Presumably you are calling someString.encode("some
>> encoding
On Fri, Oct 3, 2008 at 1:50 PM, Rob Sutherland <[EMAIL PROTECTED]> wrote:
> I'm working on a python application that stores email in a postgresql
> database and
> I'm encountering the UnicodeEncodeError - while storing a particular
> email I receive
> this error
>
> UnicodeEncodeError: 'charmap' co
I'm working on a python application that stores email in a postgresql
database and
I'm encountering the UnicodeEncodeError - while storing a particular
email I receive
this error
UnicodeEncodeError: 'charmap' codec can't encode character u'\u2019'
in position 144: character maps to
I'm a little
[EMAIL PROTECTED] wrote:
> Hi list,
>
> i am using site-package (webPy) that generates
> "UnicodeEncodeError: 'ascii' codec can't encode characters
> in position 0-6: ordinal not in range(128)".
It looks like your data contains unicode strings. When you call str() on
a unicode string it tries to
Hi list,
i am using site-package (webPy) that generates
"UnicodeEncodeError: 'ascii' codec can't encode characters
in position 0-6: ordinal not in range(128)".
The full message is:
Traceback (most recent call last):
File "c:\python24\lib\site-packages\web.py", line 1786, in
run_wsgi_app
res
26 matches
Mail list logo