M
Mr. X.
I have a problem showing hebrew on my site.
Please, help.
Here is the code :
web.config
=======
<configuration>
<system.web>
<customErrors mode="Off"/>
<identity impersonate="true"/>
<globalization
requestEncoding="windows-1255"
responseEncoding="windows-1255"
fileEncoding="windows-1255"
culture="he-IL"
uiCulture="he-IL"
/>
</system.web>
</configuration>
....
I put web.config on the main directory of the site (where there is
index.html - main default page).
test.aspx
======
<%@ Import Namespace="System.IO" %>
<html>
<head>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="TEXT/HTML; CHARSET=WINDOWS-1255">
<script runat="server" charset="windows-1255">
sub Page_Load(sender as Object, e as EventArgs)
Dim FILENAME as String = Server.MapPath("test.txt")
Dim objStreamReader as StreamReader
objStreamReader = File.OpenText(FILENAME)
Dim contents as String = objStreamReader.ReadToEnd()
test_text.text = contents.Replace(vbCrLf, "<br>")
objStreamReader.Close()
test_text.readonly = true
end sub
</script>
<title>Test</title>
</head>
<body text = "black" bgcolor = "#ffffff">
<form runat="server">
<asp:textbox TextMode = "MultiLine" id = "test_text" runat="server" width =
"300" height = "300" />
</form>
</body>
</html>
test.txt is a simple text ascii file with some Hebrew.
The site supports dot-net (it's a windows dot net platform).
The page is loaded correctly, except instead of Hebrew I see many question
marks (something like : ??? ??? ??????)
What is wrong on my code ?
Thanks
Please, help.
Here is the code :
web.config
=======
<configuration>
<system.web>
<customErrors mode="Off"/>
<identity impersonate="true"/>
<globalization
requestEncoding="windows-1255"
responseEncoding="windows-1255"
fileEncoding="windows-1255"
culture="he-IL"
uiCulture="he-IL"
/>
</system.web>
</configuration>
....
I put web.config on the main directory of the site (where there is
index.html - main default page).
test.aspx
======
<%@ Import Namespace="System.IO" %>
<html>
<head>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="TEXT/HTML; CHARSET=WINDOWS-1255">
<script runat="server" charset="windows-1255">
sub Page_Load(sender as Object, e as EventArgs)
Dim FILENAME as String = Server.MapPath("test.txt")
Dim objStreamReader as StreamReader
objStreamReader = File.OpenText(FILENAME)
Dim contents as String = objStreamReader.ReadToEnd()
test_text.text = contents.Replace(vbCrLf, "<br>")
objStreamReader.Close()
test_text.readonly = true
end sub
</script>
<title>Test</title>
</head>
<body text = "black" bgcolor = "#ffffff">
<form runat="server">
<asp:textbox TextMode = "MultiLine" id = "test_text" runat="server" width =
"300" height = "300" />
</form>
</body>
</html>
test.txt is a simple text ascii file with some Hebrew.
The site supports dot-net (it's a windows dot net platform).
The page is loaded correctly, except instead of Hebrew I see many question
marks (something like : ??? ??? ??????)
What is wrong on my code ?
Thanks