metaregistrar / php-epp-client

Object-oriented PHP EPP Client
https://www.metaregistrar.com/docs/
MIT License
214 stars 156 forks source link

Missing example: Using eppIDNA #131

Closed BrainFeeder closed 6 years ago

BrainFeeder commented 6 years ago

I could not find this in the examples. Is it correct to do:

...
$idna = new Metaregistrar\EPP\eppIDNA();
$domain = new Metaregistrar\EPP\eppDomain($idna->encode(domainname), $registrant);
$create = new Metaregistrar\EPP\eppCreateDomainRequest($domain, true);
...

Or should it be used differently?

metaregistrar commented 6 years ago

The eppIDNA() class is only used for encoding and decoding domain names from UTF-8 to IDNA (punycode)

So the example you are using looks correct: $idna->encode() will change the domain name from tëst.com to xn--tst-jma.com

Please note that some registries want punycode when you submit a non-ASCII domain name over EPP, others are quite fine with UTF-8 for the same domain.

BrainFeeder commented 6 years ago

The old system we use just encodes everything, so I'll keep doing that I guess :D Thanks for the tip.