Kaynağa Gözat

[Feature] Add punycoded versions for IDN domains

Issue: #554
Reported by: @moisseev
tags/1.2.0
Vsevolod Stakhov 8 yıl önce
ebeveyn
işleme
cba661ad9b

+ 714
- 275
contrib/publicsuffix/effective_tld_names.dat
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle


+ 20
- 0
contrib/publicsuffix/idn.pl Dosyayı Görüntüle

#!/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…
İptal
Kaydet