I have a utf8 character set database storing English and Farsi characters. When displayed via a web browser and through MySQL queries in the MySQL shell all characters are displayed properly. However, when retrieving data via ASP all of the non-English characters
come out as question marks, e.g., "?". (If I look at non-downloaded Farsi characters via my web browser they are fine. If I look at the database characters with phpMyAdmin - 2.11.6 they are fine. It's only when I've downloaded them while in the browser that
they become ? marks. )
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnString
'Create the recordset object
Set objRec = Server.CreateObject("ADODB.RecordSet")
'Build the Demographic_Answers SQL string
strSQL = "Select ABC_Statements FROM fa_statements WHERE ID_Statements = " & bytID_Statements
' Open the recordset using the query built
objRec.Open strSQL, objConn
When I do:
Response.Write("bytID_Statements is " & bytID_Statements & "<br><br>")
response.write("ABC_Statements is " & objRec("ABC_Statements") & "<br><br>")
response.end
<div>Right after this. I get:</div><div>
</div><div> bytID_Statements is 1
ABC_Statements is ?? ??? ?? ??? ????? ????? ????? ?????. ?? ????? ????? ?? ??? ?? ??? ?? ????? ??? ?? ?? ??? ???? ??? ????? ?? ? ?????????? ????? ???.</div><div>
</div><div>So it could be that I need to tell ASP to expect a Farsi character set, although I have no idea how I might do this as I have:</div><div>
</div><div> charset=utf-8</div><div>
</div><div>in the Header.</div>
I just tried the same thing with Danish. The result was that the special Danish characters, like æ, å, ä, ø, ö, did not work. Rather they showed up as a Question Mark with a black rectangle on a corner. As opposed to a regular Question Mark with the Farsi.
None
0 Points
13 Posts
Downloading Farsi via ASP
Jul 13, 2010 11:36 AM|shiesl|LINK
I have a utf8 character set database storing English and Farsi characters. When displayed via a web browser and through MySQL queries in the MySQL shell all characters are displayed properly. However, when retrieving data via ASP all of the non-English characters come out as question marks, e.g., "?". (If I look at non-downloaded Farsi characters via my web browser they are fine. If I look at the database characters with phpMyAdmin - 2.11.6 they are fine. It's only when I've downloaded them while in the browser that they become ? marks. )
I have:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
in the header and:
"http://www.w3.org/TR/html4/loose.dtd"; dir="rtl" lang="fa">
before the header.
I also have
<p dir="rtl" lang="fa"> </p>
around the Farsi string downloaded.
Thanks to all.
Rick
<p> html asp.net
All-Star
32861 Points
7877 Posts
Re: Downloading Farsi via ASP
Jul 14, 2010 01:02 AM|qwe123kids|LINK
if u talking abou adding custom Font
http://www.codeproject.com/KB/aspnet/Dynamic_Headings.aspx
chk the b aov elink
Avinash Tiwari
Remember to click “Mark as Answer” on the post, if it helps you.
Member
230 Points
70 Posts
Re: Downloading Farsi via ASP
Jul 14, 2010 02:05 AM|snop222|LINK
The first line for every ASP:
None
0 Points
13 Posts
Re: Downloading Farsi via ASP
Jul 14, 2010 08:48 AM|shiesl|LINK
Thanks for your suggestions but I'm not using a custom font and I'm not using VB on this page, thus the problem still exists.
Rick
None
0 Points
13 Posts
Re: Downloading Farsi via ASP
Jul 14, 2010 09:18 AM|shiesl|LINK
I did try the <%@ Language=VBScript CodePage=65001 %>, even though not using VB on this page and it did not help. I do appreciate the attempt.
Rick
Member
230 Points
70 Posts
Re: Downloading Farsi via ASP
Jul 15, 2010 01:55 AM|snop222|LINK
When you save the ASP file, what codepage the ASP file is encrypted ? It should be UTF-8: 65001.
None
0 Points
13 Posts
Re: Downloading Farsi via ASP
Jul 15, 2010 02:50 AM|shiesl|LINK
I did add:
<%@ Language=VBScript CodePage=65001 %>
to the beginning of the file, thinking it might help. But it makes no difference. Same problem.
I'm starting to think I need to tell ASP it's a Farsi character set when I'm obtaining the information. i have the standard:
<div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste">strConnString = "Driver={MySQL ODBC 3.51 Driver}; SERVER=localhost;" & "DATABASE=PIPII; UID=mike; PASSWORD=rick; OPTION=3"</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> </div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> 'Create the connection object</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> Set objConn = Server.CreateObject("ADODB.Connection")</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> objConn.Open strConnString</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> </div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> 'Create the recordset object</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> Set objRec = Server.CreateObject("ADODB.RecordSet") </div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> </div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> 'Build the Demographic_Answers SQL string</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> strSQL = "Select PIP_Statements FROM fa_statements WHERE ID_Statements = " & bytID_Statements</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> </div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> ' Open the recordset using the query built</div> <div style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;" id="_mcePaste"> objRec.Open strSQL, objConn</div>strConnString = "Driver={MySQL ODBC 3.51 Driver}; SERVER=localhost;" & "DATABASE=ABC; UID=1234; PASSWORD=5678; OPTION=3"
'Create the connection object
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open strConnString
'Create the recordset object
Set objRec = Server.CreateObject("ADODB.RecordSet")
'Build the Demographic_Answers SQL string
strSQL = "Select ABC_Statements FROM fa_statements WHERE ID_Statements = " & bytID_Statements
' Open the recordset using the query built
objRec.Open strSQL, objConn
When I do:
Response.Write("bytID_Statements is " & bytID_Statements & "<br><br>")
response.write("ABC_Statements is " & objRec("ABC_Statements") & "<br><br>")
response.end
<div>Right after this. I get:</div><div></div><div> bytID_Statements is 1
ABC_Statements is ?? ??? ?? ??? ????? ????? ????? ?????. ?? ????? ????? ?? ??? ?? ??? ?? ????? ??? ?? ?? ??? ???? ??? ????? ?? ? ?????????? ????? ???.</div><div>
</div><div>So it could be that I need to tell ASP to expect a Farsi character set, although I have no idea how I might do this as I have:</div><div>
</div><div> charset=utf-8</div><div>
</div><div>in the Header.</div>
Member
230 Points
70 Posts
Re: Downloading Farsi via ASP
Jul 15, 2010 03:55 AM|snop222|LINK
What tool do you use to edit the ASP files ? Before saving file, check the encoding for the file. It should be "UTF-8" encoding !
None
0 Points
13 Posts
Re: Downloading Farsi via ASP
Jul 15, 2010 08:13 AM|shiesl|LINK
To edit the ASP files I'm using Dreamweaver. To edit the MySQL files I'm using phpMyAdmin.
The ASP files are set to UTF-8. The MySQL files are set to uft8_unicode_ci.
None
0 Points
13 Posts
Re: Downloading Farsi via ASP
Jul 15, 2010 10:43 AM|shiesl|LINK
I just tried the same thing with Danish. The result was that the special Danish characters, like æ, å, ä, ø, ö, did not work. Rather they showed up as a Question Mark with a black rectangle on a corner. As opposed to a regular Question Mark with the Farsi.