Bug fix for error in non-default sublink encoding (1 Viewer)

Vasek

Portal Member
December 13, 2006
47
4
47
Liberec
Home Country
Czech Republic Czech Republic
Hi,
it seems not many people need it, but there is small bug in WebEPG Sublink grabber using non-default encoding. I.e. my grabber (see attachement) uses at the time utf-8. Independent on settings in the grabber, for sublink parser default (iso-8859-1, see HTMLPage.cs) encoding is always used. The bug is in HTTPRequest.cs file, functino:

public HTTPRequest Add(string relativeUri)

The problem is, that in Add new HTTPRequest is always created and set based on relativeUri, but there is no in formation about encoding in relativeUri, so default is used and settings from grabber is lost. Solution is to set encoding to new object according to the old settings. I did the fix, which works, here is my version of Add function:

public HTTPRequest Add(string relativeUri)
{
if (relativeUri.StartsWith("?"))
relativeUri = Uri.LocalPath + relativeUri;
Uri newUri = new Uri(Uri, relativeUri);
HTTPRequest newHTTPRequest = new HTTPRequest(newUri);
newHTTPRequest._encoding = this._encoding;
return newHTTPRequest;
}

The old (buggy) version is:

public HTTPRequest Add(string relativeUri)
{
if (relativeUri.StartsWith("?"))
relativeUri = Uri.LocalPath + relativeUri;
Uri newUri = new Uri(Uri, relativeUri);
return new HTTPRequest(newUri);
}

I ask some developer make a fix in official (SVN) version.

I attached fixed version of influenced Utils.dll for 1.0.0.RC3 and for 0.2.3 versions.

Good luck everybody

Vasek
 

Attachments

  • www_ceskenoviny_cz.xml
    30.7 KB

Vasek

Portal Member
December 13, 2006
47
4
47
Liberec
Home Country
Czech Republic Czech Republic
Hi,
It no problem, but maybe RC3 patch will work even for RC2. Please try it first. RC3 patch had a problem in 0.2.3 - some other utility functions have changed and using RC3 patch in MP0.2.3 caused no list of videos shown in My videos screen (and maybe some other things I do not know).
But not many things changed in this area between RC2 and RC3. Try it and if some problem occurs, I will do the new patch (I just need to download all sources for RC2, which takes some time).

Vasek
 

Users who are viewing this thread

Top Bottom