There seems to be an bug in the XML parser that the server uses for fetching data at runtime. I think I can build a workaround, which would slow down the data fetching a little bit, by running the data through a different XML parser first; the parser used by the JDOM library, for example, seems to work OK with it.

That workaround would involve modifying the server. Another option would be to write a standlone little JSP proxy file which fetches the URL, and runs the XML through the apache parser and re-emits it as UTF-8. That is probably a simpler and more modular solution for this bug.

If you have trouble writing such a thing, I can describe in more detail how to do it. It would probably be best to use the apache HTTPClient library that we are using now to fetch the data, and the JDOM or apache parser to parse it.

I filed a bug http://www.openlaszlo.org/jira/browse/LPP-1177 on this issue.




On 12/1/05, jake yang <[EMAIL PROTECTED]> wrote:

Hi

I recently want to use dataset to read some rss feeds, but met a encoding problem.

Here are there feeds (all of them are Chinese) I want to read:

 

http://rss.sina.com.cn/news/marquee/ddt.xml

Reading this one works well. It's xml encoding tag is < ?xml version="1.0" encoding="utf-8" ?>

 

http://www.blogchina.com/xml/2_rss2.xml

Reading this one works but I got some code can't read. It's xml encoding tag is < ?xml version=" 1.0" encoding="gb2312" ?>

 

http://www.people.com.cn/rss/sports.xml

Reading this one got an error. It's xml encoding tag is <? xml version="1.0" encoding="GB2312" ?>

ERROR: data conversion error for http://www.people.com.cn/rss/politics.xml: Parsing XML: unexpected character in markup \ufffd (position: START_TAG seen ...on>\ufffd\ufffd\ufffd\ufffd\ufffd\ubb\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ua3\ufffd\ufffd\ufffd\ufffd\u575\u78e8\ufffd\ufffd\ufffd\u7f6\ufffd\ufffd\ue861\ufffd\ufffd\ufffd\ua8e9\ufffd\ufffd\ufffd\ufffd\u53a\ufffd\ufffd\ufffd\ufffd\ufffd\u98f2\ufffd\ufffd\ufffd\u578\u3f8\ufffd\ufffd\u27b\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\ufffd<\ufffd... @145:77) 

 

Hope some one will help me, thanks!


_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user





--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to