If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Problem In Codepage 65001

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-04-04, 12:56
arqa arqa is offline
Registered User
 
Join Date: Apr 2004
Posts: 11
Problem In Codepage 65001

i have a problem with unicode utf-8 code page
Reply With Quote
  #2 (permalink)  
Old 05-10-04, 11:49
rhs98 rhs98 is offline
Super Moderator
 
Join Date: Feb 2002
Location: Hampshire, UK
Posts: 441
What problem?
Reply With Quote
  #3 (permalink)  
Old 05-12-04, 04:33
arqa arqa is offline
Registered User
 
Join Date: Apr 2004
Posts: 11
Question About Problem in ASp Page Using CODEPAGE=65001

Hi Thank You for Your Reply
My Problem IS That I Have A Web Site That Insert Some Data From Html Form In A Online WebSite My DB IS SQLSERVER And I Was Create DB And Set
Such A Properies To DB My Collation Is Arabic_CI_AS Because I Am Going to
Insert Farsi Or Arabic Data And Table rows is Using nChar And NVarchar And NText .
Other Things That My Windows Local Is Farsi And Sqlserver(In Local And Not Remote Machine Is Arabic)
In the Web Pages I Am Using Both<%@ CODEPAGE="65001"> Directive And Charset="utf-8" In Meta Tag .
But I am Encountered Such A Problem In Data Insertion :
_____________________________1____________________ ______________
1>>When I Use The <%@ CODEPAGE="65001"> In Both Of ASP Page(Form And Insert Page) The Data IS Inserted Like '??????' And Displayed In Web Page Like '??????' Anf Data Displayed In Query Analyzer Same AS WEB Pages
And Like('???????')
_____________________________2____________________ ______________
2>>When I Use The <%@ CODEPAGE="65001"> In first Page(form) And Remove This Directive In Next Pge The Data Is Displayed COrrect In Web Pages But I Cant See It Direct From Query Analyzer And Enterprise Manager ) But Data Is Not Displayed Like First Manner It Is Like A State That Code Page IS Not Correct.
_________________________ASP PAGE CODE__________________________
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%>
<html>
<head>
<title>Insert</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<body>
<form lang="fa" dir="rtl" action="ins.asp" method="post">

<input dir="rtl" lang="fa" name="name" type="text"><br>
<input dir="rtl" lang="fa" name="family" type="text"><br>
<input type="submit" value="insert">
</form>
</body>
</html>
******************** Insertion Page***************************
<%@LANGUAGE="JAVASCRIPT" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>insert</title>
</head>

<body>
<%/* CODEPAGE="65001" */
var con=Server.CreateObject('adodb.connection');
var rs=Server.CreateObject('ADODB.Recordset');
con.open("Driver={sql server};server=server; Database=mydb; uid=*****; pwd=******");
var n=Request.Form('name');
var f=Request.Form('family');
Response.Write(Request.Form("name")+'<br>');
Response.Write(Request.Form("family")+'<br>');

var sql="insert into smpl(name,family) values('"+n+"','"+f+"')";
Response.Write(sql);
con.Execute(sql);
rs.Open("select * from smpl where name='محمد مهدي' ",con);

Response.Write("<table border=1><tr><td>The Test Data List</td></tr>");
while(!rs.EOF)
{
Response.Write('<tr><td>'+rs("name")+'</td><td>'+rs("family")+'</td></tr>');
rs.MoveNext();
}
con.Close();
Response.Write("</table>");
%>
</body>
</html>
Reply With Quote
  #4 (permalink)  
Old 05-13-04, 15:21
DNA-Groove DNA-Groove is offline
Registered User
 
Join Date: May 2004
Location: Tel Aviv / Israel
Posts: 1
This is a common problem for all non-latin languages

This is your original query:

Code:
var sql="insert into smpl(name,family) values('"+n+"','"+f+"')";
Response.Write(sql);
con.Execute(sql);
rs.Open("select * from smpl where name='محمد مهدي' ",con);
It should look like this:

Code:
var sql="insert into smpl(name,family) values(N'"+n+"', N'"+f+"')";
Response.Write(sql);
con.Execute(sql);
rs.Open("select * from smpl where name=N'محمد مهدي' ",con);
The N prefix sets the field to accept unicode, instead of the local character set of the remote machine.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On