Active C Pages - Demoscond.acp counter.acp env.acp nat_chars.acp params.acp post.acp props.acp ssi.acp
| Your Region | ! | " | # | $ | % | & | ' | ( | ) | * | + | , | - | . | / | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | : | ; | < | = | > | ? | @ | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | S | T | U | V | W | X | Y | Z | [ | \ | ] | ^ | _ | ` | a | b | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | u | v | w | x | y | z | { | | | } | ~ | | € | | ‚ | ƒ | „ | † | ‡ | ˆ | ‰ | Š | ‹ | Œ | | Ž | | | ‘ | ’ | “ | ” | • | — | ˜ | ™ | š | › | œ | | ž | Ÿ | | ¡ | ¢ | £ | ¤ | ¥ | ¦ | ¨ | © | ª | « | ¬ | | ® | ¯ | ° | ± | ² | ³ | ´ | µ | ¶ | · | ¹ | º | » | ¼ | ½ | ¾ | ¿ | À | Á |  | à | Ä | Å | Æ | Ç | È | Ê | Ë | Ì | Í | Î | Ï | Ð | Ñ | Ò | Ó | Ô | Õ | Ö | × | Ø | Ù | Û | Ü | Ý | Þ | ß | à | á | â | ã | ä | å | æ | ç | è | é | ê | ì | í | î | ï | ð | ñ | ò | ó | ô | õ | ö | ÷ | ø | ù | ú | û | ý | þ | ÿ | | | | | | | | | | |
| | |
| |
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 ); %>
|