Browse Source

[Feature] Add punycoded versions for IDN domains

Issue: #554
Reported by: @moisseev
tags/1.2.0
Vsevolod Stakhov 8 years ago
parent
commit
cba661ad9b
2 changed files with 734 additions and 275 deletions
  1. 714
    275
      contrib/publicsuffix/effective_tld_names.dat
  2. 20
    0
      contrib/publicsuffix/idn.pl

+ 714
- 275
contrib/publicsuffix/effective_tld_names.dat
File diff suppressed because it is too large
View File


+ 20
- 0
contrib/publicsuffix/idn.pl View File

@@ -0,0 +1,20 @@
#!/usr/bin/env perl

use warnings;
use strict;
use Net::IDN::Encode ':all';
use Unicode::Normalize;

binmode(STDOUT, ":utf8");
binmode(STDIN, ":utf8");

while (<>) {
$_ = NFC($_);
if (/^[^\/].*[^\x00-\x7F]+.*/) {
chomp;
printf "%s\n", domain_to_ascii($_);
$_ .= "\n";
}
} continue {
print $_;
}

Loading…
Cancel
Save