Skip to content

fix(507): Add Unicode/IDN domain support to IsURL function#509

Open
varmakarthik12 wants to merge 1 commit intoasaskevich:masterfrom
varmakarthik12:fix-#507
Open

fix(507): Add Unicode/IDN domain support to IsURL function#509
varmakarthik12 wants to merge 1 commit intoasaskevich:masterfrom
varmakarthik12:fix-#507

Conversation

@varmakarthik12
Copy link
Copy Markdown

This pull request addresses issue #507 by adding Unicode/IDN (Internationalized Domain Names) support to the IsURL function.

Changes:

  • Updated URLSubdomain and URL regex patterns in patterns.go to include Unicode character ranges (\x{00a1}-\x{ffff})
  • Added test cases in validator_test.go to verify Unicode domain validation works correctly
  • Tests include domains with Unicode characters like "ñandú.com.ar" and punycode equivalent "xn--and-6ma2c.com.ar"

Why this change is needed:

  • The current IsURL function only supports ASCII characters in domain names
  • Many websites use internationalized domain names with Unicode characters
  • This enhancement makes the validator more inclusive and supports modern web standards

Testing:

  • Added comprehensive test cases covering Unicode domain scenarios
  • Verified both Unicode and punycode representations are properly validated

Fixes #507

@varmakarthik12
Copy link
Copy Markdown
Author

Hi @asaskevich, @Dadie, @attilaolah

I hope this message finds you well. I would greatly appreciate your review of this pull request, which adds Unicode/IDN domain support to the IsURL function.

This PR addresses issue #507 by:

  • Adding Unicode character range support (\x{00a1}-\x{ffff}) to URL validation patterns
  • Including comprehensive test cases for Unicode domains
  • Supporting both Unicode and punycode representations

As active contributors and maintainers of this repository, your expertise and feedback would be invaluable in ensuring the quality and compatibility of this enhancement.

Thank you for your time and consideration!

Best regards

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.

IsURL does not support Unicode/IDN internationalized domain names

1 participant