This page allows you to try the string preparation, punycode encode/decode and ToASCII/ToUnicode operations of GNU Libidn. If you encounter a problem with this page, write a (detailed!) report to bug-libidn@gnu.org.
If you are interested in commercial support or enhancement of Libidn, you can contact me.
$ CHARSET='UTF-8' idn --idna-to-ascii 'scriptalert(XSS)/script' 2>&1 scriptalert(XSS)/script $
enum
{
PUNYCODE_SUCCESS = 0,
PUNYCODE_BAD_INPUT, /* Input is invalid. */
PUNYCODE_BIG_OUTPUT, /* Output would exceed the space provided. */
PUNYCODE_OVERFLOW /* Input needs wider integers to process. */
};
typedef enum
{
STRINGPREP_OK = 0,
/* Stringprep errors. */
STRINGPREP_CONTAINS_UNASSIGNED = 1,
STRINGPREP_CONTAINS_PROHIBITED = 2,
STRINGPREP_BIDI_BOTH_L_AND_RAL = 3,
STRINGPREP_BIDI_LEADTRAIL_NOT_RAL = 4,
STRINGPREP_BIDI_CONTAINS_PROHIBITED = 5,
/* Error in calling application. */
STRINGPREP_TOO_SMALL_BUFFER = 100,
STRINGPREP_PROFILE_ERROR = 101,
STRINGPREP_FLAG_ERROR = 102,
STRINGPREP_UNKNOWN_PROFILE = 103,
/* Internal errors. */
STRINGPREP_NFKC_FAILED = 200,
STRINGPREP_MALLOC_ERROR = 201
} Stringprep_rc;
typedef enum
{
IDNA_SUCCESS = 0,
IDNA_STRINGPREP_ERROR = 1,
IDNA_PUNYCODE_ERROR = 2,
IDNA_CONTAINS_NON_LDH = 3,
/* Workaround typo in earlier versions. */
IDNA_CONTAINS_LDH = IDNA_CONTAINS_NON_LDH,
IDNA_CONTAINS_MINUS = 4,
IDNA_INVALID_LENGTH = 5,
IDNA_NO_ACE_PREFIX = 6,
IDNA_ROUNDTRIP_VERIFY_ERROR = 7,
IDNA_CONTAINS_ACE_PREFIX = 8,
IDNA_ICONV_ERROR = 9,
/* Internal errors. */
IDNA_MALLOC_ERROR = 201
} Idna_rc;