1
Vote

Compatibility with ISO 8859-1 or another encoding

description

Hi,

I've remarked, that QDFeedParser is not compatible with ISO 8859-1. Exemple : the letter "à" is changed to
"�".

To solve this problem,, I've changed the function "DownloadXml" into HttpFeedFactory :




var request = WebRequest.Create(feeduri) as HttpWebRequest;
request.KeepAlive = false;
string responseXml;

// Temporary correction (for another encoding)
var client = new WebClient();
responseXml = client.DownloadString(feeduri);

//using (var response = request.GetResponse() as HttpWebResponse)
//{
// responseXml = GetResponseXml(response);
//}

return responseXml;




This is not the good solution (but very very fast), I think that the good solution is here :




var reader = new StreamReader(response.GetResponseStream(),/ Define the encoding here !! /);
var responseXml = reader.ReadToEnd();
return responseXml;




I thank you, for reading this comment.

And sorry for my English :(

Flo

file attachments

comments

jjchiw wrote Sep 11, 2013 at 8:13 PM

Hi....

I just did the changes to this files
  • QDFeedParser/IFeedFactory.cs
  • QDFeedParser/BaseFeedFactory.cs
  • QDFeedParser/FileSystemFeedFactory.cs
  • QDFeedParser/HttpFeedFactory.cs
to accept Encoding and added a new method to BaseFeedFactory to Replace illegal characters in the xml such as:

Convert.ToChar((byte)0x01)
Convert.ToChar((byte)0x1f)


I don't know how the patches or "pull requests" works in codeplex, but I created a patch hope it helps...

Thanks