[idna] Preserve leading dots in host #337
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A retry of #171
This diff changes the behavior of ToASCII step to match the spec and
prevent failures on some cases when a domain name starts with leading
dots (FULL STOPs), as requested in
#166.
The change in the code results in a few failures for test cases of the
Conformance Testing data provided with UTS #46. But, as the header of
the test data file (IdnaTest.txt) says: "If the file does not indicate
an error, then the implementation must either have an error, or must
have a matching result."
Therefore, failing on those test cases does not break conformance with
UTS #46, and to some level, anticipated.
As mentioned in #166, a feedback
is submitted for this inconsistency and the test logic can be improved
later if the data file addresses the comments.
Until then, we can throw less errors and maintain passing conformance
tests with this diff.
To keep the side-effects of ignoring errors during test runs as minimum
as possible, I have separated
TooShortForDns
error fromTooLongForDns
. TheError
struct has been kept private, so the changewon't affect any library users.
Fix #166
This change is