Source for file example_web.php
Documentation is available at example_web.php
header( 'Content-Type: text/html; charset=UTF-8' );
$idn = Net_IDNA ::getInstance ();
if (isset ($_REQUEST['encode'])) {
$decoded = isset ($_REQUEST['decoded'])? $_REQUEST['decoded'] : '';
$encoded = $idn->encode ($decoded);
if (isset ($_REQUEST['decode'])) {
$encoded = isset ($_REQUEST['encoded'])? $_REQUEST['encoded'] : '';
$decoded = $idn->decode ($encoded);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<title>Punycode Converter</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
font-family: Helvetica, Arial, sans-serif;
background: rgb( 255, 255, 255 );
background-color: rgb( 240, 240, 240 );
<table width="780" border="0" cellpadding="0" cellspacing="0">
<strong>IDNA Converter</strong><br />
See <a href="http://faqs.org/rfcs/rfc3490.html" title="IDNA" target="_blank">RFC3490</a>,
<a href="http://faqs.org/rfcs/rfc3491.html" title="Nameprep, a Stringprep profile" target="_blank">RFC3491</a>,
<a href="http://faqs.org/rfcs/rfc3492.html" title="Punycode" target="_blank">RFC3492</a> and
<a href="http://faqs.org/rfcs/rfc3454.html" title="Stringprep" target="_blank">RFC3454</a><br />
This converter allows you to transfer domain names between the encoded (Punycode) notation and the
decoded (UTF-8) notation.<br />
Just enter the domain name in the respective field and click on the button right beside it to have
it converted. Please be aware, that you might even enter complete domain names (like jürgen-müller.de),
but without the protocol (<strong>DO NOT</strong> enter http://müller.de) or an email address.<br />
Since the underlying library is still buggy, we cannot guarantee its usefulness and correctness. You should
always doublecheck the results given here by converting them back to the original form.<br />
Any productive use is discouraged and prone to fail.<br />
Make sure, that your browser is capable of the <strong>UTF-8</strong> character encoding.<br />
<table border="0" cellpadding="2" cellspacing="2" align="center">
<td class="thead" align="left">Original</td>
<td class="thead" align="right">Punycode</td>
<form action=" <?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
<input type="text" name="decoded" value=" <?php echo $decoded; ?>" size="24" maxlength="255" />
<input type="submit" name="encode" value="Encode >>" />
<form action=" <?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
<input type="submit" name="decode" value="<< Decode" />
<input type="text" name="encoded" value=" <?php echo $encoded; ?>" size="24" maxlength="255" />
Documentation generated on Mon, 11 Mar 2019 15:41:58 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|