00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if HAVE_CONFIG_H
00023 # include "config.h"
00024 #endif
00025
00026 #include "idna.h"
00027
00028 #include "gettext.h"
00029 #define _(String) dgettext (PACKAGE, String)
00030
00064 const char *
00065 idna_strerror (Idna_rc rc)
00066 {
00067 const char *p;
00068
00069 bindtextdomain (PACKAGE, LOCALEDIR);
00070
00071 switch (rc)
00072 {
00073 case IDNA_SUCCESS:
00074 p = _("Success");
00075 break;
00076
00077 case IDNA_STRINGPREP_ERROR:
00078 p = _("String preparation failed");
00079 break;
00080
00081 case IDNA_PUNYCODE_ERROR:
00082 p = _("Punycode failed");
00083 break;
00084
00085 case IDNA_CONTAINS_NON_LDH:
00086 p = _("Non-digit/letter/hyphen in input");
00087 break;
00088
00089 case IDNA_CONTAINS_MINUS:
00090 p = _("Forbidden leading or trailing minus sign (`-')");
00091 break;
00092
00093 case IDNA_INVALID_LENGTH:
00094 p = _("Output would be too large or too small");
00095 break;
00096
00097 case IDNA_NO_ACE_PREFIX:
00098 p = _("Input does not start with ACE prefix (`xn--')");
00099 break;
00100
00101 case IDNA_ROUNDTRIP_VERIFY_ERROR:
00102 p = _("String not idempotent under ToASCII");
00103 break;
00104
00105 case IDNA_CONTAINS_ACE_PREFIX:
00106 p = _("Input already contain ACE prefix (`xn--')");
00107 break;
00108
00109 case IDNA_ICONV_ERROR:
00110 p = _("System iconv failed");
00111 break;
00112
00113 case IDNA_MALLOC_ERROR:
00114 p = _("Cannot allocate memory");
00115 break;
00116
00117 case IDNA_DLOPEN_ERROR:
00118 p = _("System dlopen failed");
00119 break;
00120
00121 default:
00122 p = _("Unknown error");
00123 break;
00124 }
00125
00126 return p;
00127 }