[opencms-dev] encoding error with rss import

Olli Aro olli_aro at yahoo.co.uk
Thu Nov 19 22:14:27 CET 2009


Hi Renate,

I am probably the best person to answer this since it is our module :)

When we created the module we could not find an easy and the same time
reliable way to detect the encoding type for the source content, so we
decided to use the default encoding defined in OpenCms, which by default
would be UTF-8. So, the characters are probably getting corrupted when the
RSS is read in in the class com.clicksandlinks.opencms.rss.HTTPDownloader.
That class uses org.apache.commons.httpclient.HttpClient in order to get the
input stream. If someone knows how to detect the encoding for an input
stream or detect it using org.apache.commons.httpclient.HttpClient let me
know and I am happy to implement the required changes in the class. 

Regards,

Olli 

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-
> bounces at opencms.org] On Behalf Of RENATA SOUZA DOS SANTOS
> Sent: 19 November 2009 18:05
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] encoding error with rss import
> 
> Hi,
> 
> I have been using the clicksandlinks module for RSS in my OpenCms site,
> but I
> had some trouble with encoding caracters.
> When I try to get news feed from this page
> http://br.hsmglobal.com/adjuntos/14/rss/Gestao.xml, I receive strange
> caracters.
> This rss feed is encoded with ISO-8859-1. Any other page encoded with
> UTF-8
> works fine. I have tried to use the enconding-content property to
> convert it,
> but I had no success.
> My database is mysql and is encoded with UTF-8.
> We use opencms with jboss-4.2.2.GA.
> Do you have any idea of the cause? How can I fix it?
> 
> Thanks,
> Renata.
> 
> --
> Prodesan S/A (http://www.prodesan.com.br/)
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please
> visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list