none
Regarding @Codepage Processing Directive RRS feed

  • Question

  • Hi,

    I have gone though one of the content from MSDN related to ASP Processing Directives specifically the @Codepage.

    In that I have encountered the below Paragraph which i am having difficulty understanding.

    There can be only one code page per response body, otherwise incorrect characters are displayed. If you set the code page explicitly in two pages, where one is called by the other by using #include, Server.Execute, or ServerTransfer, usually the parent page decides the code page. The only exception is if ResponseCodePage is explicitly set in the parent page of a Server.Execute call. In that case, an CodePage command in the child page overrides the parent code page.

    I have tried recreating the scenario mentioned above with servertransfer method by calling another ASP page. In the called(Child) ASP page the code page is getting overridden no matter what, if we define @CODEPAGE explicitly in Called(Child Page). But the above mentioned paragraph says otherwise. and the only exception is in case of serverExecute call.

    Please help me with this scenario.Thank you in Advance.

    test1.asp

    <%@ Language=VBScript CodePage=932 %>
    <%
        Dim textstring : textstring = "新しい人"
         Response.Write(textstring)
         Server.Transfer("test2.asp")    
    %>
    <p>新しい人
    <%
    Response.Write("新しい人")
    %>
    </p>

    test2.asp

    <%@ Language=VBScript CodePage=936 %>
    <%
         Dim textstring : textstring = "新人"
         Response.Write(textstring)  
    %>
    <p>新人
    <%
    Response.Write("新人")
    %>
    </p>







    Tuesday, May 15, 2018 5:59 PM

All replies

  • For ASP.Net related questions, please post to:  https://forums.asp.net

    This thread will be moved to the Off-Topic forum.


    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Tuesday, May 15, 2018 6:04 PM