From: <se...@us...> - 2007-10-03 03:14:54
|
Revision: 972 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=972&view=rev Author: sergem1 Date: 2007-10-02 20:14:49 -0700 (Tue, 02 Oct 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs trunk/plugins/ETVNet/ETVNet/Plugin.cs trunk/plugins/ETVNet/ETVNet/TODO.txt trunk/plugins/ETVNet/ETVNet/TopList.cs Modified: trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs 2007-10-02 22:59:15 UTC (rev 971) +++ trunk/plugins/ETVNet/ETVNet/ETVBrowser.cs 2007-10-03 03:14:49 UTC (rev 972) @@ -167,7 +167,7 @@ // how to check result ??? byte[] buffer = new byte[1024]; s.Read(buffer,0,1024); - String x = System.Text.Encoding.GetEncoding(0).GetString(buffer); + String x = System.Text.Encoding.UTF8.GetString(buffer); } public Hashtable getTopDirectoryPage() @@ -177,7 +177,7 @@ MatchCollection matches = regexTopLinks.Matches(todayPage, 0); // // find all stream types - archive, today, live - Hashtable streams = new Hashtable(3); + Hashtable streams = new Hashtable(4); foreach (Match match in matches) { foreach (Capture streamtype in match.Groups[3].Captures) @@ -205,6 +205,22 @@ } } } + + // special case + { + System.Collections.ArrayList list = new System.Collections.ArrayList(); + streams["\xC2\xF1\xE5 \xEA\xE0\xED\xE0\xEB\xFB"] = list; + Hashtable entry = new Hashtable(2); + entry.Add("name", "\xD1\xE5\xE3\xEE\xE4\xED\xFF \xE2 \xFD\xF4\xE8\xF0\xE5 - \xC2\xF1\xE5 \xEA\xE0\xED\xE0\xEB\xFB"); + entry.Add("url", new Uri(baseUrl, "eitv_browse.fcgi?action=today").AbsoluteUri); + list.Add(entry); + + entry = new Hashtable(2); + entry.Add("name", "\xC0\xF0\xF5\xE8\xE2 \xE2\xF1\xE5\xF5 \xEA\xE0\xED\xE0\xEB\xEE\xE2"); + entry.Add("url", new Uri(baseUrl, "eitv_browse.fcgi").AbsoluteUri); + list.Add(entry); + } + return streams; } @@ -342,8 +358,8 @@ public String getHTMLAsString(string URL, Hashtable GETData, Hashtable POSTData) { Stream responseStream = getHTML(URL, GETData, POSTData); - // default encoding for non-unicode programs, set in control panel, in all reality should be win-1251 - StreamReader urlRdr = new StreamReader(new StreamReader(responseStream).BaseStream, Encoding.GetEncoding(0)); + // UTF-8 + StreamReader urlRdr = new StreamReader(new StreamReader(responseStream).BaseStream, Encoding.UTF8); string result = urlRdr.ReadToEnd(); if (traceHTML) { @@ -378,8 +394,8 @@ { if(GETDataString.Length > 0) GETDataString += "&"; - GETDataString += HttpUtility.UrlEncode(key, Encoding.GetEncoding(0)) - + "=" + HttpUtility.UrlEncode(GETData[key].ToString(), Encoding.GetEncoding(0)); + GETDataString += HttpUtility.UrlEncode(key, Encoding.UTF8) + + "=" + HttpUtility.UrlEncode(GETData[key].ToString(), Encoding.UTF8); } } // URL encode POST data, if any @@ -390,8 +406,8 @@ { if(POSTDataString.Length > 0) POSTDataString += "&"; - POSTDataString += HttpUtility.UrlEncode(key,Encoding.GetEncoding(0)) - + "=" + HttpUtility.UrlEncode(POSTData[key].ToString(), Encoding.GetEncoding(0)); + POSTDataString += HttpUtility.UrlEncode(key, Encoding.UTF8) + + "=" + HttpUtility.UrlEncode(POSTData[key].ToString(), Encoding.UTF8); } } @@ -419,7 +435,7 @@ webRequest.UserAgent = "MediaPortal-ETVNet-Plugin/1.0"; webRequest.ContentLength = POSTDataString.Length; Stream postStream = webRequest.GetRequestStream(); - byte[] postBuffer = System.Text.Encoding.GetEncoding(0).GetBytes(POSTDataString); + byte[] postBuffer = System.Text.Encoding.UTF8.GetBytes(POSTDataString); postStream.Write(postBuffer,0,postBuffer.Length); postStream.Close(); }else Modified: trunk/plugins/ETVNet/ETVNet/Plugin.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/Plugin.cs 2007-10-02 22:59:15 UTC (rev 971) +++ trunk/plugins/ETVNet/ETVNet/Plugin.cs 2007-10-03 03:14:49 UTC (rev 972) @@ -292,8 +292,8 @@ if (ruKeyboard.done) { string searchWord = ruKeyboard.inputString; - string url = "http://dir2.etvnet.ca/cgi-bin/video/eitv_browse.fcgi?action=search&keywords=" - + HttpUtility.UrlEncode(searchWord, Encoding.GetEncoding(0)) + string url = "http://www.etvnet.ca/cgi-bin/video/eitv_browse.fcgi?action=search&keywords=" + + HttpUtility.UrlEncode(searchWord, Encoding.UTF8) +"&keywords_search_in_description=0&category=&datetime_since.day=&datetime_since.month=&datetime_since.year=&datetime_till.day=&datetime_till.month=&datetime_till.year=&duration_min=&duration_max=&rating_min=&channel=&record_type=&order_by="; currentNode = new PathPage("Search Title: " + searchWord, url, currentNode.browser, currentNode); RenderNode(); @@ -311,8 +311,8 @@ if (ruKeyboard.done) { string searchWord = ruKeyboard.inputString; - string url = "http://dir2.etvnet.ca/cgi-bin/video/eitv_browse.fcgi?action=search&keywords=" - + HttpUtility.UrlEncode(searchWord, Encoding.GetEncoding(0)) + string url = "http://www.etvnet.ca/cgi-bin/video/eitv_browse.fcgi?action=search&keywords=" + + HttpUtility.UrlEncode(searchWord, Encoding.UTF8) + "&keywords_search_in_description=1&category=&datetime_since.day=&datetime_since.month=&datetime_since.year=&datetime_till.day=&datetime_till.month=&datetime_till.year=&duration_min=&duration_max=&rating_min=&channel=&record_type=&order_by="; currentNode = new PathPage("Search Title: " + searchWord, url, currentNode.browser, currentNode); RenderNode(); Modified: trunk/plugins/ETVNet/ETVNet/TODO.txt =================================================================== --- trunk/plugins/ETVNet/ETVNet/TODO.txt 2007-10-02 22:59:15 UTC (rev 971) +++ trunk/plugins/ETVNet/ETVNet/TODO.txt 2007-10-03 03:14:49 UTC (rev 972) @@ -7,7 +7,6 @@ aspect ratio support hardware keyboard input demo link playback -page up/down on description page while focus is on the button localization Modified: trunk/plugins/ETVNet/ETVNet/TopList.cs =================================================================== --- trunk/plugins/ETVNet/ETVNet/TopList.cs 2007-10-02 22:59:15 UTC (rev 971) +++ trunk/plugins/ETVNet/ETVNet/TopList.cs 2007-10-03 03:14:49 UTC (rev 972) @@ -62,12 +62,12 @@ PathNode pathnode; if (((string)node["url"]).StartsWith("javascript:")) // stream link { - pathnode = new PathTerminal((string)node["name"], null, (string)node["url"], null, browser, this); + pathnode = new PathTerminal((string)node["name"], null, (string)node["url"], null, browser, link); } else { // archive or today page - pathnode = new PathPage((string)node["name"], (string)node["url"], browser, this); + pathnode = new PathPage((string)node["name"], (string)node["url"], browser, link); } newList.Add(pathnode); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |