libo26 / feedparser

Automatically exported from code.google.com/p/feedparser
Other
0 stars 0 forks source link

Failed to decode from locale "GB2312" when an item description contain '\xA8\x44' #124

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. Use this code to parse the attached file:

import feedparser
d = feedparser.parse(open('world.xml'))
for i in range(len(d['entries'])):
    print d['entries'][i]['title']

What is the expected output? What do you see instead?

Expect to see the Chinese characters decoded properly. But it's not. My
test shows that it's the '\xA8\x44' in the item description that is causing
this problem. (I simplified the original feed to expose the problem by
removing other items and characters in the description field.) If I replace
that with another character, say, 'a', everything works fine.

What version of the product are you using? On what operating system?

feedparser 4.1 egg file on Windows XP.

Please provide any additional information below.

Original issue reported on code.google.com by jli...@gmail.com on 20 Jun 2008 at 8:11

Attachments:

GoogleCodeExporter commented 9 years ago
Not sure if it's related to issue 54.

Original comment by jli...@gmail.com on 20 Jun 2008 at 8:38

GoogleCodeExporter commented 9 years ago
Please close this bug as fixed.

I tested using svn trunk and the attached document; entries[0].title contains 
two unicode characters that, to my untrained eye, look like Chinese characters. 
jlist9 is probably right that this was related to issue 54.

Would you try downloading the latest version in svn trunk [1] and report back 
if the problem hasn't been fixed? The bug can be reopened if you confirm the 
problem still exists.

[1]: https://feedparser.googlecode.com/svn/trunk/feedparser/feedparser.py

Original comment by kurtmckee on 4 Dec 2010 at 12:23

GoogleCodeExporter commented 9 years ago
Hi, I'm the one who filed the bug. But I don't see a button/link to
close it.

Original comment by jli...@gmail.com on 4 Dec 2010 at 4:26

GoogleCodeExporter commented 9 years ago
BTW, I tested it and it did work. Thanks for the fix!

Original comment by jli...@gmail.com on 4 Dec 2010 at 4:26

GoogleCodeExporter commented 9 years ago
I think only the maintainer can close the bug. Sorry for the confusion! I've 
been triaging a lot of bugs and I've slipped into a terse writing style.

I'm glad to hear that the bug is fixed; don't hesitate to open reports for any 
other bugs you run into!

Original comment by kurtmckee on 4 Dec 2010 at 6:21

GoogleCodeExporter commented 9 years ago

Original comment by adewale on 4 Dec 2010 at 10:19