Active C PagesTechnicalFAQDownloads

Home

ACP

Contact

Projects


Demos
Active C Pages - Demoscond.acp
counter.acp
env.acp
nat_chars.acp
params.acp
post.acp
props.acp
ssi.acp

Your Region

!"#$%&'()*+,-./
123456789:;<=>?@
BCDEFGHIJKLMNOPQ
STUVWXYZ[\]^_`ab
defghijklmnopqrs
uvwxyz{|}~ƒ
ˆŠŒŽ
˜šœžŸ ¡¢£¤¥¦
¨©ª«¬­®¯°±²³´µ·
¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈ
ÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙ
ÛÜÝÞßàáâãäåæçèéê
ìíîïðñòóôõö÷øùúû
ýþÿ
Choose your Region:


Choose your format:




Source Code

<%
    int index = 0;
    int inner = 0;
    int boxes = 8;
    char *title = NULL;
    char *charset = ACPENV_Get( params, "charset" );
    char *format = ACPENV_Get( params, "format" );
    ACPENV pages = NULL;
 
    // Default the incoming arguments
 
    if ( charset == NULL )
        charset = "null";
    if ( format == NULL )
        format = "null";
 
    // Construct the look up table for charset to text description
 
    pages = ACPENV_Init();
 
    ACPENV_Set( pages, "null", "Your Region" );
    ACPENV_Set( pages, "iso-8859-1", "Western" );
    ACPENV_Set( pages, "iso-8859-9", "Turkish" );
    ACPENV_Set( pages, "iso-8859-7", "Greek" );
    ACPENV_Set( pages, "iso-8859-3", "Polish" );
    ACPENV_Set( pages, "iso-8859-2", "Central European" );
    ACPENV_Set( pages, "big5", "Traditional Chinese" );
 
    // Obtain the title
 
    title = ACPENV_Get( pages, charset );
 
    // If no format is required, change the number of items per line
 
    if ( !strcmp( format, "null" ) )
        boxes = 16;
%>
<HTML>
<HEAD>
<IF strcmp( charset, "null" ) \>
    <META HTTP-EQUIV="Content-type" CONTENT=text/html; CHARSET=<%=s::charset%>>
</IF>
</HEAD>
<BODY>
<H1><%=s::title%></H1>
 
<TABLE>
    <TR>
        <TD>
            <TABLE BORDER=1>
            <FOR index = 32; index < 256; index ++ \>
                <TR>
                <FOR inner = index; inner < index + boxes; inner ++ \>
                    <TD>
                        <IF !strcmp( format, "null" ) \>
                            <%=c::inner%>
                        <ELSEIF !strcmp( format, "hex" ) \>
                               <CODE><%=02X::inner%>:</CODE><%=c::inner%>
                        <ELSEIF !strcmp( format, "decimal" ) \>
                               <CODE><%=03d::inner%>:</CODE><%=c::inner%>
                        </IF>
                    </TD>
                </FOR>
                <% index = inner; %>
                </TR>
            </FOR>
            </TABLE>
        </TD>
        <TD>
            <CENTER>
            <FORM ACTION=nat_chars.acp METHOD=get>
            Choose your Region:<BR>
            <SELECT NAME="charset" SIZE=1>
            <FOR index = 0; index < ACPENV_Count( pages ); index ++ \>
				<% char *current = ACPENV_GetName( pages, index ); %>
                <% char *selected = !strcmp( charset, current ) ?  "SELECTED=SELECTED" : ""; %>
                <OPTION VALUE=<%=s::current%> <%=s::selected%>>
                    <%=s::ACPENV_GetValue( pages, index )%>
                </OPTION>
            </FOR>
            </SELECT>
            <BR>
            <BR>
            Choose your format:<BR>
            <SELECT NAME="format" SIZE=1>
                <OPTION VALUE=null>None</OPTION>
                <OPTION VALUE=hex>Hexadecimal</OPTION>
                <OPTION VALUE=decimal>Decimal</OPTION>
            </SELECT>
            <BR>
            <BR>
            <INPUT type=submit value=Submit>
            </FORM>
            </CENTER>
        </TD>
    </TR>
</TABLE>
<HR>
<BR>Source Code<BR><BR>
<% ACPOUT_IncludeSource( out, ACP_GetDirOfRequestedFile( acp ), "/nat_chars.acp" ); %>
</BODY>
</HTML>
<% ACPENV_Close( pages ); %>