Skip to content

Preserve trailing empty labels in pure Ruby IDNA conversions - #609

Open
OskarEichler wants to merge 1 commit into
sporkmonger:mainfrom
OskarEichler:codex/addressable-idna-dots
Open

OskarEichler wants to merge 1 commit into
sporkmonger:mainfrom
OskarEichler:codex/addressable-idna-dots

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Retain empty trailing labels when pure Ruby IDNA splits and rejoins domain names. The native implementation already retains them. This preserves fully qualified names through direct IDNA conversion without changing URI normalization's separate trailing-dot policy.

Reproduction

require 'addressable'
p Addressable::IDNA.to_ascii('bücher.example.')
p Addressable::IDNA.to_unicode('xn--bcher-kva.example.')
# Before: final dot lost in both; after: final dot retained

Verification

  • Ruby 4.0.6 through rbenv; existing suite: 1,433 examples / 0 failures / 5 existing pending with pure Ruby IDNA, 1,466 examples / 0 failures / 5 existing pending with idn-ruby 0.1.5 + libidn.
  • 36 focused external assertions pass on this individual patch; the combined installed-release branch also passes all focused cases and both existing suites.
  • Comparative RuboCop Lint: 15 existing offenses before and after; no new offense (line references move). Syntax and git diff --check pass.

Compatibility and limitations

Direct pure-Ruby IDNA conversion now preserves trailing dots. URI#normalized_host still applies its existing normalization rule. No Unicode table update or IDNA version change.

No dependency/version/data updates. No repository tests were added or changed: the commissioning repository explicitly prohibits new/modified tests, so reproduction checks run outside this repository. Other Ruby versions/platforms were not run locally; upstream CI may require maintainer approval. The existing normalization proposal #589 and IDNA2008 proposal #496 are separate and unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant