BarrMan
09-13-2007, 10:02 AM
Hey. I've made a script that pulls information from my database to a textbox but it's not in english and it shows the letters instead of in their original form as question marks. (IE: Hello = ????).
When I opened my database to see if the information is correct there I saw that it's ok but when it draws it from the database into the textarea I get this funny looking text.
Here's my insertion code:
<%@ Language=VBScript %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html dir="rtl">
<head>
<title>
טאודור בר - מערכת ניהול
</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1255" />
</head>
<body>
<%
Function strFormat(str)
If IsEmpty(str) or IsNull(str) Then Exit Function
Str = Replace(str,"<","<")
Str = Replace(str,">",">")
Str = Replace(str,"'","'")
Str = Replace(str,"""",""")
Str = Replace(str,chr(13),"<br />")
Str = Replace(str,"'","'")
strFormat = str
End Function
Dim Lang
Dim Conn
Dim Rs
Dim SQL
Lang = Request.Form("language")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open = "PROVIDER=Microsoft.Jet.Oledb.4.0; Data Source='" & Server.MapPath("../db.mdb") & "'"
SQL = "UPDATE contents SET content = '" & StrFormat(Request.Form("txt")) & "' WHERE page='index' AND lang='" & Lang & "'"
Conn.Execute SQL
Conn.Close
Set Conn = Nothing
Response.Redirect Request.Form("url")
%>
</body>
</html>
When I opened my database to see if the information is correct there I saw that it's ok but when it draws it from the database into the textarea I get this funny looking text.
Here's my insertion code:
<%@ Language=VBScript %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html dir="rtl">
<head>
<title>
טאודור בר - מערכת ניהול
</title>
<meta http-equiv="content-type" content="text/html; charset=windows-1255" />
</head>
<body>
<%
Function strFormat(str)
If IsEmpty(str) or IsNull(str) Then Exit Function
Str = Replace(str,"<","<")
Str = Replace(str,">",">")
Str = Replace(str,"'","'")
Str = Replace(str,"""",""")
Str = Replace(str,chr(13),"<br />")
Str = Replace(str,"'","'")
strFormat = str
End Function
Dim Lang
Dim Conn
Dim Rs
Dim SQL
Lang = Request.Form("language")
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open = "PROVIDER=Microsoft.Jet.Oledb.4.0; Data Source='" & Server.MapPath("../db.mdb") & "'"
SQL = "UPDATE contents SET content = '" & StrFormat(Request.Form("txt")) & "' WHERE page='index' AND lang='" & Lang & "'"
Conn.Execute SQL
Conn.Close
Set Conn = Nothing
Response.Redirect Request.Form("url")
%>
</body>
</html>