troubleshooting Question

CLassic ASP & international chars

Avatar of tn_bobbie
tn_bobbie asked on
ASPMicrosoft IIS Web Server
5 Comments1 Solution444 ViewsLast Modified:
HI ALl,

I have an ASP page (page1.asp)  with a text box & the user is putting ¼ in the text box. I've set charset of this page to utf-8. IN the second page (page2.asp), I'm trying to insert into an Oracle table with a simple insert statement. But it turns garbled in the DB. The code is attached.

These r the datatypes I tried

COL_V_CHAR (used in code) - VARCHAR2(100 CHAR)
COL_V_BYTE (used in code) - VARCHAR2(100 CHAR)
COL_N_CHAR (used in code) - NVARCHAR2
COL_CLOB (used in code) - CLOB
COL_NCLOB (used in code) - NCLOB

Nothing worked, its all junk in all the columns.

I'm not suspecting Oracle because, when I use a plain insert statement like

INSERT INTO TABLE(COL) VALUES('¼'). It is saved good in DB & I can see that as is..

SO the IIS (IIS6 in this case) is doing something.

An ideas??

Thanks
Bobbie
Page1.asp
<%@ Language=VBScript%>
<%Session.Codepage=65001%>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<form name="frm" action="test2.asp" method="POST">
	<input type="text" name="txt1">
	<input type="submit" value="submit">
</form>
--------------------------------------------------------------
Page2.asp
<%
Session.Codepage=65001
dim strTestSQL, strJustification
 
strJustification = "µ"
 
strJustification = Request.Form("txt1")
 
Response.Write(strJustification & "---strJustification<br />")
 
Response.Write(Request.Form("txt1") & "---Request.Form)<br />")
			
'strTestSQL = "UPDATE OUTLIER_HISTORY SET RESUB_JUSTIFICATION = ' µ  -- Inserting with SQL INSERT stat' WHERE OUTLIER_HISTORY_ID = 89188"
'strTestSQL = "UPDATE OUTLIER_HISTORY SET RESUB_JUSTIFICATION = '" & strJustification & "' WHERE OUTLIER_HISTORY_ID = 89188"
 
strTestSQL = "INSERT INTO NAGENDRATEST(COL_V_CHAR, COL_V_BYTE, COL_N_CHAR, COL_CLOB, COL_NCLOB) VALUES ('" & Request.Form("txt1") & "','" & strJustification & "','" & Request.Form("txt1") & "','" & Request.Form("txt1") & "','" & Request.Form("txt1") & "'  )"
 
Response.Write(strTestSQL & "--strTestSQL<BR />")
				
cnConnect.Execute(strTestSQL)
				
Response.Write("--Done<BR />")
%>
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros