I cannot search using Arabic letters

Last post 09-17-2008 6:29 AM by Hong-Gang Chen - MSFT. 1 replies.

Sort Posts:

  • I cannot search using Arabic letters

    09-12-2008, 8:45 AM
    • Member
      32 point Member
    • elshorbagy
    • Member since 08-15-2008, 12:48 PM
    • Posts 59

    Hello,

    I'm using Youtube APIs to search videos from ASP.Net page and dsiplay the result in a gridview .I'm using codebehind 

    here is my code:

        protected void Page_Load(object sender, EventArgs e)
        {
           
            if (Request.Form["v"] != null)
            {
                Session["search"] = Request.Form["v"];
            }
           try
           {
                string developerKey = ConfigurationManager.AppSettings["developerKey"];
                string uri = "http://www.youtube.com/api2_rest?";
                uri += "method=youtube.videos.list_by_tag";
                uri += "&dev_id=" + developerKey;
                uri += "&tag=" +  Session["search"];
                uri += "&page=1&per_page=100";
                DataSet ds = new DataSet();          
                ds.ReadXml(uri);
               
                DataTable dt = ds.Tables[2];
                
                this.GridView1.DataSource = dt;
                GridView1.DataBind();
       }
          catch
            {
               Response.Write("<center><b><font color='red'>Error in Retrieving Data</font></b></center>");
          }
        }

     When I use an English word it works fine, but when I try to search using an Arabic word, the word looks like this "??????"

    how can I resolve this problem?

    Thank you

    Get the maximum security with Kaspersky Internet Security 2010 http://notechsoft.com/security.asp?p=3
  • Re: I cannot search using Arabic letters

    09-17-2008, 6:29 AM
    Answer

    elshorbagy:

    Hello,

    I'm using Youtube APIs to search videos from ASP.Net page and dsiplay the result in a gridview .I'm using codebehind 

    here is my code:

        protected void Page_Load(object sender, EventArgs e)
        {
           
            if (Request.Form["v"] != null)
            {
                Session["search"] = Request.Form["v"];
            }
           try
           {
                string developerKey = ConfigurationManager.AppSettings["developerKey"];
                string uri = "http://www.youtube.com/api2_rest?";
                uri += "method=youtube.videos.list_by_tag";
                uri += "&dev_id=" + developerKey;
                uri += "&tag=" +  Session["search"];
                uri += "&page=1&per_page=100";
                DataSet ds = new DataSet();          
                ds.ReadXml(uri);
               
                DataTable dt = ds.Tables[2];
                
                this.GridView1.DataSource = dt;
                GridView1.DataBind();
       }
          catch
            {
               Response.Write("<center><b><font color='red'>Error in Retrieving Data</font></b></center>");
          }
        }

    When I use an English word it works fine, but when I try to search using an Arabic word, the word looks like this "??????"

    Hi elshorbagy,

    I suggest you post your problem on this link,

    http://code.google.com/apis/youtube/overview.html

    Based on my experience, this problem mostly lay on the APIs, for example, as we know that maybe language has their own encoding, like “gb2312”, so some times the client user set the “Big5” as the default encoding, it will show like “????” on the page, for preventing this, we always set “ responseEncoding="gb2312" in the web.config file.  So I mean that maybe there is some default encoding in the APIs, but I think maybe there is somewhere could set the encoding with the APIs.
    Hong-Gang Chen
    Microsoft Online Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Page 1 of 1 (2 items)