Net_IDNA
[ class tree: Net_IDNA ] [ index: Net_IDNA ] [ all elements ]

Source for file test_php4.php

Documentation is available at test_php4.php

  1. <?php
  2.  
  3. header'Content-Type: text/html; charset=UTF-8' );
  4.  
  5. require 'Net/IDNA.php';
  6.  
  7.  
  8. $idn Net_IDNA::getInstance();
  9.  
  10. if (isset($_REQUEST['encode'])) {
  11.     $decoded = isset($_REQUEST['decoded'])$_REQUEST['decoded''';
  12.     $encoded $idn->encode($decoded);
  13. }
  14.  
  15. if (isset($_REQUEST['decode'])) {
  16.     $encoded = isset($_REQUEST['encoded'])$_REQUEST['encoded''';
  17.     $decoded $idn->decode($encoded);
  18. }
  19.  
  20. if (!isset($encoded)) {
  21.     $encoded '';
  22. }
  23.  
  24. if (!isset($decoded)) {
  25.     $decoded '';
  26. }
  27.  
  28. ?>
  29. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  30.  
  31. <html>
  32. <head>
  33.  
  34. <title>Punycode Converter</title>
  35.  
  36. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  37.  
  38. <style type="text/css">
  39.  
  40. body
  41. {
  42.     font-family:        Helvetica, Arial, sans-serif;
  43.     font-size:          10pt;
  44.     background:         rgb( 255, 255, 255 );
  45. }
  46.  
  47. #centered
  48. {
  49.     text-align:         center;
  50.     vertical-align:     middle;
  51. }
  52.  
  53. #round
  54. {
  55.     background-color:   rgb( 240, 240, 240 );
  56.     border:             1px solid black;
  57.     text-align:         center;
  58.     vertical-align:     middle;
  59.     padding:            4px;
  60. }
  61.  
  62. #subhead
  63. {
  64.     font-size:          8pt;
  65. }
  66.  
  67. </style>
  68.  
  69. </head>
  70.  
  71. <body>
  72.  
  73. <table width="780" border="0" cellpadding="0" cellspacing="0">
  74. <tr>
  75.     <td id="centered">
  76.     <div id="round">
  77.     <strong>IDNA Converter</strong><br />
  78.  
  79.     <span id="subhead">
  80.     See <a href="http://faqs.org/rfcs/rfc3490.html" title="IDNA" target="_blank">RFC3490</a>,
  81.     <a href="http://faqs.org/rfcs/rfc3491.html" title="Nameprep, a Stringprep profile" target="_blank">RFC3491</a>,
  82.     <a href="http://faqs.org/rfcs/rfc3492.html" title="Punycode" target="_blank">RFC3492</a> and
  83.     <a href="http://faqs.org/rfcs/rfc3454.html" title="Stringprep" target="_blank">RFC3454</a><br />
  84.     </span>
  85.    
  86.     <br />
  87.  
  88.     This converter allows you to transfer domain names between the encoded (Punycode) notation and the
  89.     decoded (UTF-8) notation.<br />
  90.    
  91.     Just enter the domain name in the respective field and click on the button right beside it to have
  92.     it converted. Please be aware, that you might even enter complete domain names (like j&#xFC;rgen-m&#xFC;ller.de),
  93.     but without the protocol (<strong>DO NOT</strong> enter http://m&#xFC;ller.de) or an email address.<br />
  94.    
  95.     Since the underlying library is still buggy, we cannot guarantee its usefulness and correctness. You should
  96.     always doublecheck the results given here by converting them back to the original form.<br />
  97.    
  98.     Any productive use is discouraged and prone to fail.<br />
  99.    
  100.     <br />
  101.    
  102.     Make sure, that your browser is capable of the <strong>UTF-8</strong> character encoding.<br />
  103.     
  104.     <br />
  105.     
  106.     <table border="0" cellpadding="2" cellspacing="2" align="center">
  107.     <tr>
  108.         <td class="thead" align="left">Original</td>
  109.         <td class="thead" align="right">Punycode</td>
  110.     </tr>
  111.     
  112.     <tr>
  113.         <td>
  114.         <form action="<?php echo $_SERVER['PHP_SELF']?>" method="GET">
  115.         <input type="text" name="decoded" value="<?php echo $decoded?>" size="24" maxlength="255" />
  116.         <input type="submit" name="encode" value="Encode &gt;&gt;" />
  117.         </form>
  118.         </td>
  119.         
  120.         <td>
  121.         <form action="<?php echo $_SERVER['PHP_SELF']?>" method="GET">
  122.         <input type="submit" name="decode" value="&lt;&lt; Decode" />
  123.         <input type="text" name="encoded" value="<?php echo $encoded?>" size="24" maxlength="255" />
  124.         </form>
  125.         </td>
  126.     </tr>
  127.     </table>
  128.     </div>
  129.     </td>
  130. </tr>
  131. </table>
  132.  
  133. </body>
  134. </html>

Documentation generated on Mon, 11 Mar 2019 15:37:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.