mirror of
https://github.com/spatie/dnsrecords.io.git
synced 2026-04-29 09:25:52 +03:00
[GH-ISSUE #39] Convert unicode letters to punycode #16
Labels
No labels
bug
good first issue
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/dnsrecords.io#16
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TheAlexLichter on GitHub (Feb 23, 2018).
Original GitHub issue: https://github.com/spatie/dnsrecords.io/issues/39
A few minutes ago I wanted to look up the DNS settings for "ms-umzüge.de", which contains a German umlaut (öäü). Unfortunately, those are stripped out since #9 came through. It'd not suffice to just accept them because
digwouldn't find the Unicode domain. You would also need to convert the domain to Punycode.(Same would apply to Chinese letters)
@freekmurze commented on GitHub (Feb 23, 2018):
Feel free to submit a PR to fix this.
@crock commented on GitHub (Feb 23, 2018):
I'll try to fix this.
@mattiasgeniar commented on GitHub (Feb 23, 2018):
Some pointers having implemented this myself;
Explicit character sets
When calling
digyou'll want to explicitly set the Character Set viaCHARSET=ASCII. Ie:This'll require some love in Dns.php.
Conversions
Before & after each DNS lookup, you'll want to throw in some idn_to_ascii() & idn_to_utf8().
Once you tell
digto use the ASCII charset, you feed it only ascii chars. The response will also be ascii, so you have to convert that back to IDN for the human readable version.@crock commented on GitHub (Feb 23, 2018):
I'm a little confused. Is the proposed Conversion changes above supposed to be made in this repo or just in https://github.com/spatie/dns because
Dns.phpis in the other repo.@freekmurze commented on GitHub (Feb 23, 2018):
@mattiasgeniar thanks for your wisdom here!
@crock dnsrecords.io uses spatie/dns under the hood. So send your PR to spatie/dns.