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 information about encoding in relativeUri, so default is used and settings from grabber is lost. There is simple solution: setting of encoding of 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 have already post it some time ago, but probably not in right forum (https://forum.team-mediaportal.com/webepg-136/bug-fix-error-non-default-sublink-encoding-47867/). Sorry for that, it is my first patch.
Vasek
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 information about encoding in relativeUri, so default is used and settings from grabber is lost. There is simple solution: setting of encoding of 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 have already post it some time ago, but probably not in right forum (https://forum.team-mediaportal.com/webepg-136/bug-fix-error-non-default-sublink-encoding-47867/). Sorry for that, it is my first patch.
Vasek