https://github.com/centralnicgroup-opensource/rtldev-middleware-idna-uts46
A UTS #46 processing algorithm for IDNA2008 strings
https://github.com/centralnicgroup-opensource/rtldev-middleware-idna-uts46
Last synced: 4 months ago
JSON representation
A UTS #46 processing algorithm for IDNA2008 strings
- Host: GitHub
- URL: https://github.com/centralnicgroup-opensource/rtldev-middleware-idna-uts46
- Owner: centralnicgroup-opensource
- License: other
- Created: 2017-04-10T12:24:15.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-30T04:43:39.000Z (8 months ago)
- Last Synced: 2024-10-30T07:26:23.353Z (8 months ago)
- Language: HTML
- Size: 4.39 MB
- Stars: 12
- Watchers: 5
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# IDNA-UTS #46 in JavaScript
[](https://www.npmjs.com/package/idna-uts46-hx)
[](https://www.npmjs.com/package/idna-uts46-hx)
[](https://github.com/semantic-release/semantic-release)
[](https://opensource.org/licenses/MIT)
[](https://github.com/hexonet/idna-uts46/blob/master/CONTRIBUTING.md)This module is a IDNA UTS46 connector library for javascript. In addition to the default functionality of tr46, we offer converting domain names to unicode / punycode considering the respective registry provider's behavior.
The [JS Punycode converter library](https://github.com/bestiejs/punycode.js/) is
a great tool for handling Unicode domain names, but it only implements the
Punycode encoding of domain labels, not the full IDNA algorithm. In simple
cases, a mere conversion to lowercase text before input would seem sufficient,
but the real mapping for strings is far more complex. This library implements
the full mapping for these strings, as defined by
[UTS #46](http://unicode.org/reports/tr46/).## Resources
- [Documentation](https://support.centralnicreseller.com/hc/en-gb/articles/13509920188061-JavaScript-based-IDN-Converter)
- [Release Notes](https://github.com/hexonet/idna-uts46/releases)## v6 Notes & Migration Guide
With v6 we migrated our library to npm package `tr46` as software dependency. By that step we use a library that is actively maintained in direction of correctly supporting the `TR46` standard and supporting the latest Version of the Unicode Standard. Reinventing the wheel isn't useful and something we have time or resources for. We were able to dramatically decrease the number of lines of code on our end.
### Improvements
- method `toUnicode` comes with auto-detection of `transitionalProcessing` setting based on the provided domain name input
- method `toAscii` comes with auto-detection of `transitionalProcessing` setting based on the provided domain name input### Breaking Changes
In general, we don't see a blocker for upgrading to v6. Still, consider the below changes.
#### Performance
Runtime performance of v6 compared to v5 has slightly improved. The compression for the underlying idna mapping table is superfluous, tr46 covers it well.
#### New Labels for Options
The below configuration options for the methods `toUnicode`and `toAscii` must be renamed in case you're using them:
| **Option, old** | **Option, new** |
| --------------- | ---------------------- |
| transitional | transitionalProcessing |
| useStd3ASCII | useSTD3ASCIIRules |
| verifyDnsLength | verifyDNSLength |#### Behavior
Earlier versions kept option `transitional` by default to false which is now automatically detected and results may therefore differ.
This affects the `toAscii` method.The `toUnicode` function did not allow for a options parameter in earlier versions, now it follows the exemplary way of package `tr46`.
## Authors
- [KaiSchwarz-cnic](https://github.com/kaischwarz-cnic)
**Thanks for the below former contributions:**
- Initial work done by [jcranmer](https://github.com/jcranmer).
- v5: Migration of the IDNA Mapping Table's Build Process from Python to NodeJS5 by [dawsbot](https://github.com/dawsbot)
- v5: Performance Improvements for the Browser Bundle's Page Load by [dawsbot](https://github.com/dawsbot)See also the list of [contributors](https://github.com/hexonet/idna-uts46/graphs/contributors) who participated in this project.
## License
MIT