Solved

How can I  change the asp page encoding to greek?

Posted on 2004-10-25
805 Views
Last Modified: 2011-10-03
I have a cms and I am not very familiar with .asp.
The content managmenet system is based on a default.asp page where it takes several values (id=1--> x) and accordingly shows different pages of the website.

When I change the encoding of the IE or Firefox browser to windows - greek - 1253 the fonts are perfect.

Howe can I automate this change so that each time any page is loaded it changes the ecnoding automatically to greek>? Thanks in advance

Below I provide you with the defualt.asp code.

<%@LANGUAGE="VBSCRIPT"%>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=windows-1252">
<%
'On Error Resume Next
Response.CacheControl = "Public"
'Option Explicit
%>
<!--#include file="Connections/connCMS.asp" -->
<%
If Application("DestroyCache") = "" Then
      Call DestroyCache
      Application.Lock
      Application("DestroyCache") = "1"
      Application.UnLock()
End If
Dim GFDB, strSN, strSiteName, appPageNum, intStart, MyWebPage, IsPageDynamic, MyVisitors, MyDate, Page_Content
Dim MyScript, MyResultsPageScript, rownum
appPageNum = Request("Page")
If appPageNum = "" Then appPageNum = "0"
strSiteName = Replace(strSP2,"/","")
If strSiteName = "" Then strSiteName = "CMS"
If Application(strSiteName & "_Page" & appPageNum) = "" Then GFDB = True
If Application(strSiteName & "_Content" & appPageNum) = "" Then GFDB = True
%>
<%
intStart = timer
If Request("ap") <> "" Then
      If Session("xpage") <> "" Then
            appPageNum = Session("xpage")
            GFDB = False
      End If
End If
Session("xpage") = ""
MyWebPage = ""
IsPageDynamic = 0
MyVisitors = Application("ActiveUsers")
MyDate = FormatDateTime(Date(), vbLongDate)
Page_Content = ""
MyScript = "<" + chr(37) + "Server.Execute({ASP_page_to_execute}) " + chr(37) + ">"
MyResultsPageScript = "<% Server.Execute(""ASP\"" & Request.QueryString(""ap"")) "&chr(37)&">"

'*****************************************
' Start of Get From Database
'*****************************************
If GFDB Then
Function GetFldData(fldnum,varCheck)
      Dim RecFound, ipage
      RecFound = False
      For ipage = 0 to numrows
            If MyPages(fldnum,ipage) = varCheck Then
                  RecFound = True
                  Exit For
            End If
      Next
      If NOT Recfound Then ipage = -1
      GetFldData = ipage
End Function
Function GetFldData2(fldnum2,varCheck2)
      Dim RecFound2, jpage
      RecFound2 = False
      For jpage = 0 to numrows2
            If MyTemplates(fldnum2,jpage) = varCheck2 Then
                  RecFound2 = True
                  Exit For
            End If
      Next
      If NOT Recfound2 Then jpage = -1
      GetFldData2 = jpage
End Function
Dim com, rsTemplate, MyPages, rsTmplts, numrows, numrows2
Set con = Server.CreateObject("ADODB.Connection")
con.Open MM_connCMS_STRING
Set rsTemplate = con.Execute("SELECT * FROM qryTemplate_Content")
MyPages = rsTemplate.GetRows()
rsTemplate.close()
Set rsTemplate = Nothing
Set rsTmplts = con.Execute("SELECT * FROM CMS_Templates")
MyTemplates = rsTmplts.GetRows()
rsTmplts.close()
Set rsTmplts = Nothing
con.Close
Set con = Nothing

numrows=ubound(MyPages,2)
numrows2=ubound(MyTemplates,2)

If appPageNum = "0" Then
      rownum = GetFldData(7,1)
Else
      rownum = GetFldData(0,CInt(appPageNum))
End If
If rownum > -1 Then
      Dim MyWebPageID, MyDocTitle, MyASPpage, MyPageTitle, MyPageHeadContent, MyBgcolor
      Dim Page_Template, ParentPage, MyRegistration, strDCmenuH, strDCmenuH1, strDCmenuH2
      Dim strDCmenuV, strDCmenuV1, strDCmenuV2, MyMainMenu, MyDivider, MySubMenu, MyBullet
      Dim MyVar1, MyVar2, MyVar3, MyToken1, MyMenu1, MyMenuID1, MyBC, MyBCdivider, WasHomePage
      Dim MySearch
      MyWebPageID = MyPages(0,rownum)
      MyDocTitle = MyPages(5,rownum)
      MyASPpage = MyPages(14,rownum)
      Application.Lock
      Application(strSiteName & "_ASPPage" & CStr(MyWebPageID)) = MyASPpage
      Application.UnLock
      MyPageTitle = MyPages(2,rownum)
      MyPageHeadContent = MyPages(12,rownum)
      If MyPages(18,rownum) = 1 Then
            MyPrSc = "<!-- {IsPrivate} -->" & vbCrlf & ""
            MyPageHeadContent = MyPrSc & MyPageHeadContent
      End If
      MyBgcolor = MyPages(4,rownum)            
      Page_Template = MyPages(3,rownum)
      Page_Content = MyPages(6,rownum)
      MyWebPage = Replace(Page_Template,"{Content}","{PageContent}")
      ParentPage = MyPages(8,rownum)
      MyRegistration = MyPages(16,rownum)
      If ParentPage > 0 and Not IsNull(ParentPage) Then
            rownum2 = GetFldData2(0,ParentPage)
            While rownum2 > -1
                  MyWebPage = Replace(MyTemplates(2,rownum2),"{Content}",MyWebPage)
                  ParentPage = MyTemplates(6,rownum2)
                  MyBgcolor = MyTemplates(3,rownum2)
                  rownum2 = GetFldData2(0,ParentPage)
            Wend
      End If
      If (InStr(1,MyWebPage,"{hMenu}") > 0) Then
            strDCmenuH = "<script type=""text/javascript"">" & vbCrLf
            strDCmenuH = strDCmenuH & "var m1 = new COOLjsMenuPRO(""menu1"", MENU_ITEMS)" & vbCrLf
            strDCmenuH = strDCmenuH & "m1.initTop();" & vbCrLf
            strDCmenuH = strDCmenuH & "</script>" & vbCrLf
            strDCmenuH = strDCmenuH & "<script type=""text/javascript"">" & vbCrLf
            strDCmenuH = strDCmenuH & "m1.init();" & vbCrLf
            strDCmenuH = strDCmenuH & "m1.show();" & vbCrLf
            strDCmenuH = strDCmenuH & "</script>" & vbCrLf
            strDCmenuH1 = strDCmenuH1 &  "<LINK href=""CMSmenu/style.css"" type=text/css rel=stylesheet>" & vbCrLf
            strDCmenuH1 = strDCmenuH1 &  "<SCRIPT src=""CMSmenu/menu.js"" type=text/javascript></SCRIPT>" & vbCrLf
            strDCmenuH1 = strDCmenuH1 &  "<SCRIPT src=""ASP/menuitems.JS"" type=text/javascript></SCRIPT>" & vbCrLf & "</head>"
            MyWebPage = Replace(MyWebPage,"{hMenu}",strDCmenuH)
            MyPageHeadContent = Replace(MyPageHeadContent,"</head>",strDCmenuH1)
      End If
      If (InStr(1,MyWebPage,"{vcMenu}") > 0) Then
            strDCmenuV = "<SCRIPT type=text/javascript>" & vbCrLf
            strDCmenuV = strDCmenuV & "var tree = new COOLjsTreePRO(""tree1"", TREE1_NODES, TREE1_FORMAT);" & vbCrLf
            strDCmenuV = strDCmenuV & "tree.init();" & vbCrLf
            strDCmenuV = strDCmenuV & "</SCRIPT>"
            strDCmenuV1 = strDCmenuV1 & "<link href=""CMSmenu/menuv.css"" type=text/css rel=stylesheet>" & vbCrLf
            strDCmenuV1 = strDCmenuV1 & "<script language=""JavaScript"" src=""CMSmenu/menuv.js""></script>" & vbCrLf
            strDCmenuV1 = strDCmenuV1 & "<script language=""JavaScript"" src=""CMSmenu/menuv_format.js""></script>" & vbCrLf
            strDCmenuV1 = strDCmenuV1 & "<script language=""JavaScript"" src=""ASP/menuv_nodes.js""></script>" & vbCrLf & "</head>"
            strDCmenuV2 = strDCmenuV2 &  "<script language=""JavaScript"">RedrawAllTrees()</script>" & vbCrLf & "</body>"
            MyWebPage = Replace(MyWebPage,"{vcMenu}",strDCmenuV)
            MyPageHeadContent = Replace(MyPageHeadContent,"</head>",strDCmenuV1)
            MyPageHeadContent = Replace(MyPageHeadContent,"</body>",strDCmenuV2)
      End If
      If (InStr(1,MyWebPage,"{MainMenu}") > 0) or (InStr(1,Page_Content,"{MainMenu}") > 0)  Then
            MyMainMenu = ""
            MyDivider = " | "
            For i = 0 to numrows
                  If MyPages(9,i) = 0 And MyPages(10,i) = 1 Then
                        If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                        MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                  End If
            Next
            MyWebPage = Replace(MyWebPage,"{MainMenu}",MyMainMenu)
            Page_Content = Replace(Page_Content,"{MainMenu}",MyMainMenu)
      End If
      If (InStr(1,MyWebPage,"{MainMenuV}") > 0) or (InStr(1,Page_Content,"{MainMenuV}") > 0) Then
            MySubMenu = ""
            MyBullet = "&#8226;" & "&nbsp;"
            For i = 0 to numrows
                  If MyPages(9,i) = 0 And MyPages(10,i) = 1 Then
                        MySubMenu = MySubMenu & MyBullet & "<a href='Default.asp?Page=" & MyPages(0,i) & "'>" & MyPages(2,i) & "</a><br>"
                  End If
            Next
            MyWebPage = Replace(MyWebPage,"{MainMenuV}",MySubMenu)
            Page_Content = Replace(Page_Content,"{MainMenuV}",MySubMenu)
      End If
      If (InStr(1,MyWebPage,"{Submenu}") > 0) or (InStr(1,Page_Content,"{Submenu}") > 0) Then
            MyMainMenu = ""
            MyDivider = "&#8226;" & "&nbsp;"
            For i = 0 to numrows
                  If MyPages(9,i) = MyWebPageID And MyPages(10,i) = 1 Then
                        MyMainMenu = MyMainMenu & MyDivider & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A><br>"
                  End If
            Next
            MyWebPage = Replace(MyWebPage,"{Submenu}",MyMainMenu)
            Page_Content = Replace(Page_Content,"{Submenu}",MyMainMenu)
      End If
      If (InStr(1,MyWebPage,"{hSubmenu}") > 0) or (InStr(1,Page_Content,"{hSubmenu}") > 0) Then
            MyMainMenu = ""
            MyDivider = " | "
            For i = 0 to numrows
                  If MyPages(9,i) = MyWebPageID And MyPages(10,i) = 1 Then
                        If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                        MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                  End If
            Next
            MyWebPage = Replace(MyWebPage,"{hSubmenu}",MyMainMenu)
            Page_Content = Replace(Page_Content,"{hSubmenu}",MyMainMenu)
      End If
      If (InStr(1,Page_Content,"{{Submenu=") > 0) Then
            MyVar1 = InStr(1,Page_Content,"{{Submenu")
            MyVar2 = MyVar1 + 10
            MyVar3 = InStr(1,Page_Content,"}}")
            MyToken1 = Mid(Page_Content,MyVar1,(MyVar3 + 2 - MyVar1))
            MyMenu1 = Mid(MyToken1,11,(MyVar3 - MyVar2))
            rownum = GetFldData(2,MyMenu1)
            If rownum > -1 Then
                  MyMenuID1 = MyPages(0,rownum)
                  MySubMenu = ""
                  MyBullet = "&#8226;" & "&nbsp;"
                  For i = 0 to numrows
                        If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                              MySubMenu = MySubMenu & MyBullet & "<a href='Default.asp?Page=" & MyPages(0,i) & "'>" & MyPages(2,i) & "</a><br>"
                        End If
                  Next
                  Page_Content = Replace(Page_Content,MyToken1,MySubMenu)
            End If
      End If
      If (InStr(1,MyWebPage,"{{Submenu=") > 0) Then
            MyVar1 = InStr(1,MyWebPage,"{{Submenu")
            MyVar2 = MyVar1 + 10
            MyVar3 = InStr(1,MyWebPage,"}}")
            MyToken1 = Mid(MyWebPage,MyVar1,(MyVar3 + 2 - MyVar1))
            MyMenu1 = Mid(MyToken1,11,(MyVar3 - MyVar2))
            rownum = GetFldData(2,MyMenu1)
            If rownum > -1 Then
                  MyMenuID1 = MyPages(0,rownum)
                  MySubMenu = ""
                  MyBullet = "&#8226;" & "&nbsp;"
                  For i = 0 to numrows
                        If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                              MySubMenu = MySubMenu & MyBullet & "<a href='Default.asp?Page=" & MyPages(0,i) & "'>" & MyPages(2,i) & "</a><br>"
                        End If
                  Next
                  MyWebPage = Replace(MyWebPage,MyToken1,MySubMenu)
            End If
      End If
      If (InStr(1,Page_Content,"{{hSubmenu=") > 0) Then
            MyVar1 = InStr(1,Page_Content,"{{h")
            MyVar2 = MyVar1 + 11
            MyVar3 = InStr(1,Page_Content,"}}")
            MyToken1 = Mid(Page_Content,MyVar1,(MyVar3 + 2 - MyVar1))
            MyMenu1 = Mid(MyToken1,12,(MyVar3 - MyVar2))
            rownum = GetFldData(2,MyMenu1)
            If rownum > -1 Then
                  MyMenuID1 = MyPages(0,rownum)
                  MyMainMenu = ""
                  MyDivider = " | "
                  For i = 0 to numrows
                        If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                              If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                              MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                        End If
                  Next
                  Page_Content = Replace(Page_Content,MyToken1,MyMainMenu)
            End If
      End If
      If (InStr(1,MyWebPage,"{{hSubmenu=") > 0) Then
            MyVar1 = InStr(1,MyWebPage,"{{h")
            MyVar2 = MyVar1 + 11
            MyVar3 = InStr(1,MyWebPage,"}}")
            MyToken1 = Mid(MyWebPage,MyVar1,(MyVar3 + 2 - MyVar1))
            MyMenu1 = Mid(MyToken1,12,(MyVar3 - MyVar2))
            rownum = GetFldData(2,MyMenu1)
            If rownum > -1 Then
                  MyMenuID1 = MyPages(0,rownum)
                  MyMainMenu = ""
                  MyDivider = " | "
                  For i = 0 to numrows
                        If MyPages(9,i) = MyMenuID1 And MyPages(10,i) = 1 Then
                              If MyMainMenu <> "" Then MyMainMenu = MyMainMenu & MyDivider
                              MyMainMenu = MyMainMenu & "<A href='Default.asp?page=" & CStr(MyPages(0,i)) & "'>" & MyPages(2,i) & "</A>"
                        End If
                  Next
                  MyWebPage = Replace(MyWebPage,MyToken1,MyMainMenu)
            End If
      End If
      If (InStr(1,MyWebPage,"{Breadcrumbs}") > 0) or (InStr(1,Page_Content,"{Breadcrumbs}") > 0) Then
            ParentPage = MyWebPageID
            MyBC = ""
            MyBCdivider = " > "
            WasHomePage = 1
            rownum = GetFldData(0,ParentPage)
            While ParentPage <> 0
                  If MyBC <> "" Then MyBC = MyBCdivider & MyBC
                  MyBC = "<a href='Default.asp?Page=" & MyPages(0,rownum) & "'>" & MyPages(2,rownum) & "</a>" & MyBC
                  ParentPage = MyPages(9,rownum)
                  If ParentPage = 0 and MyPages(7,rownum) = 0 Then
                        WasHomePage = 0
                  End If
                  rownum = GetFldData(0,ParentPage)            
            Wend
            If WasHomePage = 0 Then
                  MyBC = "<a href='Default.asp'>Home</a>" & MyBCdivider & MyBC
            End If            
            MyWebPage = Replace(MyWebPage,"{Breadcrumbs}",MyBC)
            Page_Content = Replace(Page_Content,"{Breadcrumbs}",MyBC)
      End If
      If (InStr(1,MyWebPage,"{Search}") > 0) or (InStr(1,Page_Content,"{Search}") > 0) Then
            MySearch = ""
            MySearch = MySearch + "<form name=" + Chr(34) + "SearchForm" + Chr(34) + " method=" + Chr(34) + "post" + Chr(34) + " action=" + Chr(34) + "default.asp" + Chr(34) + ">" + VbCrLf
            MySearch = MySearch + "Site Search<br>" + VbCrLf
            MySearch = MySearch + "<input name=" + Chr(34) + "CMSsearch" + Chr(34) + " type=" + Chr(34) + "text" + Chr(34) + " size=" + Chr(34) + "12" + Chr(34) + ">" + VbCrLf
            MySearch = MySearch + "<input name=" + Chr(34) + "CMS_search" + Chr(34) + " type=" + Chr(34) + "submit" + Chr(34) + " id=" + Chr(34) + "CMS_search" + Chr(34) + " value=" + Chr(34) + "Go" + Chr(34) + ">" + VbCrLf
            MySearch = MySearch + "<input name=" + Chr(34) + "Page" + Chr(34) + " type=" + Chr(34) + "hidden" + Chr(34) + " value=" + Chr(34) + CStr(MyWebPageID) + Chr(34) + ">" + VbCrLf
            MySearch = MySearch + "<input name=" + Chr(34) + "Search" + Chr(34) + " type=" + Chr(34) + "hidden" + Chr(34) + " value=" + Chr(34) + "true" + Chr(34) + ">" + VbCrLf
            MySearch = MySearch + "</form>"
            MyWebPage = Replace(MyWebPage,"{Search}",MySearch)
            Page_Content = Replace(Page_Content,"{Search}",MySearch)
      End If

      MyWebPage = Replace(MyPageHeadContent,"{content}",MyWebPage)
      MyWebPage = Replace(MyWebPage,"{bgcolor}",MyBgcolor)
      MyWebPage = Replace(MyWebPage,"{DocTitle}",MyDocTitle)
      MyWebPage = Replace(MyWebPage,"{PageTitle}",MyPageTitle)
      MyWebPage = Replace(MyWebPage,"{Register}",MyRegistration)
      Page_Content = Replace(Page_Content,"{PageTitle}",MyPageTitle)
      Page_Content = Replace(Page_Content,"{Register}",MyRegistration)
      Application.Lock
      Application(strSiteName & "_Page" & CStr(MyWebPageID)) = MyWebPage
      Application(strSiteName & "_Content" & CStr(MyWebPageID)) = Page_Content
      Application.UnLock
Else
      MyWebPage = "That Web Page is not Found."
End If
Set MyPages = Nothing
Set MyTemplates = Nothing
Else
      MyWebPage = Application(strSiteName & "_Page" & appPageNum)
      Page_Content = Application(strSiteName & "_Content" & appPageNum)
      MyASPpage = Application(strSiteName & "_ASPPage" & appPageNum)
End If
'*****************************************
' End of Get From Database
'*****************************************
IsPageResults = False
ExecuteExternalASPpage = False
If Request("ap") <> "" Then MyASPpage = Request("ap")
If MyASPpage <> "" Then IsPageResults = True
RunScript = "RunScript.asp"
If MyASPpage <> "" Then
      ExecuteExternalASPpage = True
End If
If Request.QueryString <> "" Then RunScript = RunScript + "?" + Request.QueryString
If Request.QueryString("msg") <> "" Then
      Page_Content = Request.QueryString("msg")
      IsPageResults = True
End If
Function MakeQS(fvar,fvarname,fpage)
      NewQS = fvar
      AddParam = True
      If (InStr(1,fvar,"?") > 0) Then
            MyParams1 = Mid(fvar,InStr(1,fvar,"?")+1,Len(fvar))
            MyParams = Split(MyParams1,"&")
            AddParam = True
            For Each i in MyParams
                  If Ucase(Left(i,InStr(1,i,"=")-1)) = Ucase(Trim(fvarname)) Then AddParam = False
            Next
      End If
      If AddParam Then
            If (InStr(1,fvar,"?") > 0) Then
                  NewQS = fvar + "&" + fvarname + "=" + fpage
            Else
                  NewQS = fvar + "?" + fvarname + "=" + fpage
            End If
      End If
      MakeQS = NewQS
End Function
Function InsertASPpage(fntoken,fnpage)
      InsertASPpage = Replace(MyWebPage,fntoken,Replace(MyScript,"{ASP_page_to_execute}",chr(34) + "ASP/" + fnpage + chr(34)))
End Function
Function DisplayTokenByType(strT1, strT2, strASPpg, strType)
      DisplayTokenByType = False
      If InStr(1,MyWebPage,strT1) > 0 Then
            intVar = Len(strT1)
            IsPageDynamic = 1
            intVar1 = InStr(1,MyWebPage,strT1)
            intVar3 = InStr(1,MyWebPage,strT2)
            strToken = Mid(MyWebPage,intVar1,intVar3-intVar1+intVar)
            strTokenType = Mid(strToken,InStr(1,strToken,"=") + 1)
            strTokenType = Mid(strTokenType,1,InStr(1,strTokenType,"=") - 1)
            MyWebPage = InsertASPpage(strToken,strASPpg)
            If (InStr(1,RunScript,strType) = 0) Then
                  RunScript = MakeQS(RunScript,strType,strTokenType)
            End If
            DisplayTokenByType = True
      End If
End Function

If Request("ap") <> "" Then Page_Content = "{Dynamic}"
If Request.QueryString("AR") <> "" Then Page_Content = "{Dynamic}"
If Request.QueryString("NWS") <> "" Then Page_Content = "{Dynamic}"
If Request.QueryString("PR") <> "" Then Page_Content = "{Dynamic}"
If Request.QueryString("ce") <> "" Then Page_Content = "{Dynamic}"
If Request.Form("Search") <> "" Then Page_Content = "{#%SearchResults}"
If Request.QueryString("FAQ") <> "" Then Page_Content = "{Dynamic}"
IsHelpDesk = False
If (InStr(1,Page_Content,"{HelpDesk}") > 0) Then
      IsHelpDesk = True
      Page_Content = "{Dynamic}"
End If
AllowAccess = True
If ((InStr(1,MyWebPage,"{IsPrivate") > 0) or IsHelpDesk) and Request.QueryString("np") <> "1" Then
      Session("xpage") = appPageNum
      If Session("LoggedIn") <> "Yes" Then
            AllowAccess = False
            Page_Content = "{Dynamic}"
      End If
End If
MyWebPage = Replace(MyWebPage,"{PageContent}",Page_Content)
If Request.Form("Search") <> "" Then
      Set con = Server.CreateObject("ADODB.Connection")
         con.Open MM_connCMS_STRING
    Set rsSearch = con.Execute("SELECT CMS_ID,CMS_Name FROM WebContent WHERE CMS_Active = 1 AND CMS_Content LIKE '%" & Request.Form("CMSsearch") & "%'")
      MySCounter = 1
      MySR = "<strong>Search Results</strong><br><br>"
      If Not rsSearch.eof Then
            While Not rsSearch.eof
                  MySR = MySR + CStr(MySCounter) + ". - <a href=" + Chr(34) + "Default.asp?Page=" + CStr(rsSearch("CMS_ID")) + Chr(34) + ">" + rsSearch("CMS_Name") + "</a><br>"
                  rsSearch.MoveNext()
                  MySCounter = MySCounter + 1
            Wend
      Else
            MySR = MySR + "No Pages Match Your Search..."
      End If
      Set rsSearch = Nothing
      con.Close
    Set con = Nothing
      MyWebPage = Replace(MyWebPage,"{#%SearchResults}",MySR)
      GFDB = True
End If
If InStr(1,MyWebPage,"{Dynamic}") > 0 Or Request("ap") <> "" Then
      IsPageDynamic = 1
      Session("xpage") = appPageNum
      IsPageResults = True
End If
MyWebPage = Replace(MyWebPage,"{Dynamic}",MyResultsPageScript)
PageName = "ASP\Pg" & appPageNum & ".asp"
If IsPageResults Then PageName = "ASP\~Pg" & appPageNum & ".asp"
If ExecuteExternalASPpage Then
      PageName = "ASP\~PgDefault.asp"
      If Request("ap") = "" Then
            RunScript = MakeQS(RunScript,"ap",MyASPpage)
      End If
End If
If IsHelpDesk Then
      If AllowAccess Then
            RunScript = MakeQS(RunScript,"ap","HD_List.asp")
      Else
            RunScript = MakeQS(RunScript,"ap","Member_Login.asp")
      End If
End If
If Not AllowAccess Then RunScript = MakeQS(RunScript,"ap","Member_Login.asp")
'*****************************************
' Start of Prepare file for Write
'*****************************************
      If Request.QueryString("AR") <> "" Then
            RunScript = MakeQS(RunScript,"ap","NewsArticleDetail.asp")
      End If
      If Request.QueryString("NWS") <> "" Then
            RunScript = MakeQS(RunScript,"ap","NewsDetail.asp")
      End If
      If Request.QueryString("PR") <> "" Then
            RunScript = MakeQS(RunScript,"ap","DisplayPollResults.asp")
      End If
      If Request.QueryString("ce") <> "" Then
            RunScript = MakeQS(RunScript,"ap","DisplayEvents.asp")
      End If
      If Request.QueryString("FAQ") <> "" Then
            RunScript = MakeQS(RunScript,"ap","FAQDetail.asp")
      End If
      If InStr(1,MyWebPage,"{NewsArticles2}") > 0 Then
            IsPageDynamic = 1
            MyWebPage = InsertASPpage("{NewsArticles2}","DisplayNewsArticles2.asp")
      End If
      If InStr(1,MyWebPage,"{NewsArticles}") > 0 Then
            IsPageDynamic = 1
            MyWebPage = InsertASPpage("{NewsArticles}","DisplayNewsArticles.asp")
      End If
      If InStr(1,MyWebPage,"{NewsCat}") > 0 Then
            IsPageDynamic = 1
            MyWebPage = InsertASPpage("{NewsCat}","DisplayNewsCat.asp")
      End If
      MyPhantomVar = DisplayTokenByType("{News2=","=News2}","DisplayNews2.asp","Article_type")
      MyPhantomVar = DisplayTokenByType("{News=","=News}","DisplayNews.asp","Article_type")
      If InStr(1,MyWebPage,"{FAQcat}") > 0 Then
            IsPageDynamic = 1
            MyWebPage = InsertASPpage("{FAQcat}","DisplayFAQcat.asp")
      End If
      MyPhantomVar = DisplayTokenByType("{FAQ=","=FAQ}","DisplayFAQs.asp","FAQ_type")
      MyPhantomVar = DisplayTokenByType("{Calendar=","=Calendar}","DisplayCalendar.asp","Event_type")
      MyPhantomVar = DisplayTokenByType("{Calendar2=","=Calendar2}","DisplayCalendar2.asp","Event_type")
      If InStr(1,MyWebPage,"{%Poll=") > 0 Then
            IsPageDynamic = 1
            PollVar1 = InStr(1,MyWebPage,"{%")
            PollVar2 = PollVar1 + 7
            PollVar3 = InStr(1,MyWebPage,"%}")
            MyPollToken = Mid(MyWebPage,PollVar1,(PollVar3 + 2 - PollVar1))
            MyPoll = Mid(MyPollToken,8,(PollVar3 - PollVar2))
            MyWebPage = InsertASPpage(MyPollToken,"DisplayPoll.asp")
            RunScript = MakeQS(RunScript,"Poll_ID",MyPoll)
      End If
      If InStr(1,MyWebPage,"{Calendar2}") > 0 Then
            IsPageDynamic = 1
            MyWebPage = InsertASPpage("{Calendar2}","DisplayCalendar2.asp")
      End If
      If InStr(1,MyWebPage,"{Calendar}") > 0 Then
            IsPageDynamic = 1
            MyWebPage = InsertASPpage("{Calendar}","DisplayCalendar.asp")
      End If
'*****************************************
' End of Prepare file for Write
'*****************************************
intEnd = timer
MyTimer = FormatNumber(intEnd - intStart,4)
MyWebPage = Replace(MyWebPage,"{Timer}",MyTimer)
If IsPageDynamic = 1 Then
      MyWebPage = Replace(MyWebPage,"{Date}","<" + chr(37) + "=FormatDateTime(Date(), vbLongDate)" + chr(37) + ">")
      MyWebPage = Replace(MyWebPage,"{ActiveUsers}","<" + chr(37) + "=Application(" + chr(34) + "ActiveUsers" + chr(34) + ")" + chr(37) + ">")
      Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
      If GFDB Or Not objFSO.FileExists(Server.MapPath(PageName)) Then
            Set objText = objFSO.OpenTextFile(Server.MapPath(PageName),2,True)
            objText.Write MyWebPage
            objText.Close
            Set objText = Nothing
      End If
       Set objFSO = Nothing
      RunScript = MakeQS(RunScript,"p",PageName)
      'RunScript = MakeQS(RunScript,"page",MyWebPageID)
      'Response.Write(Runscript)
      'Response.End()
      Response.Redirect(RunScript)
End If
MyWebPage = Replace(MyWebPage,"{Date}",MyDate)
MyWebPage = Replace(MyWebPage,"{ActiveUsers}",MyVisitors)
Response.Write(MyWebPage)
%>
0
Question by:fzd
    2 Comments
     
    LVL 15

    Accepted Solution

    by:
    Response.charset will allow you to change it to a specific language charset

    http://www.intellidimension.com/default.rsp?topic=/pages/rdfgateway/reference/script/response_charset.rsp
    0
     
    LVL 15

    Expert Comment

    by:justinbillig
    so for greek after

    Response.CacheControl = "Public"

    put

    Response.charset = "iso-8859-7 "
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Prepare to Pass the CompTIA A+ 900 Series Exam

    CompTIA aims to adapt its A+ Certification to reflect the most current knowledge and skills needed by today's IT professionals--and this year's 2016 exam is harder than ever. This certification is one of the most highly-respected and sought after in IT.

    Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    845 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    3 Experts available now in Live!

    Get 1:1 Help Now