Hey folks, I face a really weird problem, I currently working on a search form for a company that has Arabic letters for their users first name and last name, the problem is that the web page I designed using vb script and sql2005 db cant show the results for any search using Arabic letters. For being sure that the problem is with Arabic letters I placed bunch of records with English alphabet and the search was successful so a record like John as first name and Man as last name was found.
Details of work: two asp classic pages, one contain a HTML form with get method that send three values: 1) first name, 2) last name, 3)submit button name, the second page contains a recordset filtered by two request.querystring parameters (both pages have charset=utf-8 set and Arabic characters are showing fine in the second page URL in FF and chrome but if I copy from those browsers and paste it here they appear encoded like IE8.)
Since IE 8 is an old crap it shows the arabic letters in url like this:
Code:
http://localhost/panel/user-names.asp?FirstName=%D8%A2%D8%B1%D8%B4&SurName=%D8%AA%D8%B3%D8%AA&button=%D9%86%D9%85%D8%A7%DB%8C%D8%B4+%D9%86%D8%AA%D8%A7%DB%8C%D8%AC
But in Chrome and FF its like this :
Code:
localhost/panel/user-names.asp?FirstName=آرش&SurName=تست&button=نمایش+نتایج
is it because of decode?
is it because of UTF?
is it because of database?
is it because of anything else?
Please help me out here folks.
first page (contains the form).
Code:
<form name="My_Choice" method="get" action="user-names.asp" >
<input name="FirstName" type="text" class="mediumfield" id="FirstName" value="" />
<input name="SurName" type="text" class="mediumfield" id="SurName" value="" />
<input name="button" type="submit" class="submit" id="button" value="نمایش نتایج" />
</form>
Second page (recordset) yes this is Dreamweaver generated code with my customization
Code:
<%
Dim rs_list1__MMColParam1
rs_list1__MMColParam1 = "0"
If (Request.QueryString("FirstName") <> "") Then
rs_list1__MMColParam1 = Request.QueryString("FirstName")
End If
%>
<%
Dim rs_list1__MMColParam2
rs_list1__MMColParam2 = "0"
If (Request.QueryString("SurName") <> "") Then
rs_list1__MMColParam2 = Request.QueryString("SurName")
End If
%>
<%
Dim rs_list1
Dim rs_list1_cmd
Dim rs_list1_numRows
Set rs_list1_cmd = Server.CreateObject ("ADODB.Command")
rs_list1_cmd.ActiveConnection = MM_admin_trustees_STRING
rs_list1_cmd.CommandText = "SELECT * FROM dbo.LoginUsers WHERE FirstName = ? AND SurName = ? ORDER BY SurName ASC"
rs_list1_cmd.Prepared = true
rs_list1_cmd.Parameters.Append rs_list1_cmd.CreateParameter("param1", 200, 1, 255, rs_list1__MMColParam1) ' adVarChar
rs_list1_cmd.Parameters.Append rs_list1_cmd.CreateParameter("param2", 200, 1, 255, rs_list1__MMColParam2) ' adVarChar
Set rs_list1 = rs_list1_cmd.Execute
rs_list1_numRows = 0
%>