#include #include #include int main() { // input, output and result of the operation char *output; int result; // try to convert the invalid domain name result = idna_to_unicode_8z8z(".org", &output, IDNA_USE_STD3_ASCII_RULES); // the .org domain is obviously bogus, so we expect an error if (result != IDNA_SUCCESS) return 0; // idna considered the bogus name valid, this is an error fprintf(stderr, "libidn considered our bogus domain name valid, and converted it to: '%s'\n", output); free(output); // something went wrong return 1; }