Skip to content

Instantly share code, notes, and snippets.

@Timi7007
Last active February 13, 2018 16:18
Show Gist options
  • Save Timi7007/860a1028bb4531375b56337971731943 to your computer and use it in GitHub Desktop.
Save Timi7007/860a1028bb4531375b56337971731943 to your computer and use it in GitHub Desktop.
Simple web-based IDN to ACE & ACE to IDN converter written in PHP. Requires php-intl. Demo: http://usf01.timlukas.de/idn.php
<?php
// You need php-intl to run this!
$input = $_POST['domain'];
echo '<html>
<head>
<title>IDN Converter</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="https://timlukas.de/favicon.ico" type="image/x-icon" />
<link rel="icon" href="https://timlukas.de/favicon.ico" type="image/x-icon" />
<style>
.box {
height: 100%;
width: 100%;
background-color: #000013;
font-size: 24px;
font-style: oblique;
color: #FFFFFF;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<div class="box">
<div class="body">
<img src="https://timlukas.de/timlukas.de-logo.png" alt="timlukas.de" style="height:100px;float:right;" />
<h1>IDN Converter</h1>
<form method="post" action="idn_converter.php">
<input type="text" name="domain" value="'.$input.'">
<input type="submit" value="Covert">
</form>
'.idn_to_utf8("$input").'
<br>
'.idn_to_ascii("$input").'
</div>
</div>
</body>
</html>';
?>
@syno1997
Copy link

Danke voll nützlich für meine Arbeit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment