'Nodejs Detect punycode IDN language

I know there are libraries like bestiejs/punycode.js or NodeJS PunnyCode to convert punycode, but I can't find any library that detect punycode languages(Geek, Chinese, etc).

Is that possible to detect punycode language natively or it has to use different software to detect the languages.

Also, is there any NodeJs library can use for punycode language detection?



Solution 1:[1]

The punycode is the ASCII (8 bit) representation of an otherwise 16 bit Unicode based Internationalized Domain Name. The conversion to punycode is termed as a variable length encoding and is a mathematical process, involving additional processings like case-folding and normalization to Unicode Form C. Owing to the mathematical nature of the punycode, the language information, as such is not supposed to be part of the punycode representation as such at all. It is the Unicode equivalent of the given punycode, that lies in specific Unicode range/block which gives the given character it's own script/language.

Hence, if one needs to have language/script detection capability of the IDN, then it needs to be converted to it's U-Label form first and then passed on to language/script detection routines.

To know about the various libraries that can be used in different programming languages for converting punycodes to their respective Unicode labels, please refer to the following two documents created by the "Universal Acceptance Steering Group"

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ThinkTrans