1 /* idna.h Declarations for IDNA.
2 * Copyright (C) 2002, 2003 Simon Josefsson
4 * This file is part of GNU Libidn.
6 * GNU Libidn is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * GNU Libidn is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with GNU Libidn; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 IDNA_STRINGPREP_ERROR
= 1,
35 IDNA_PUNYCODE_ERROR
= 2,
36 IDNA_CONTAINS_LDH
= 3,
37 IDNA_CONTAINS_MINUS
= 4,
38 IDNA_INVALID_LENGTH
= 5,
39 IDNA_NO_ACE_PREFIX
= 6,
40 IDNA_ROUNDTRIP_VERIFY_ERROR
= 7,
41 IDNA_CONTAINS_ACE_PREFIX
= 8,
43 /* Internal errors. */
44 IDNA_MALLOC_ERROR
= 201
47 #ifndef IDNA_ACE_PREFIX
48 #define IDNA_ACE_PREFIX "xn--"
51 extern int idna_to_ascii (const unsigned long *in
,
55 int usestd3asciirules
);
57 extern int idna_to_ascii_from_ucs4 (const unsigned long *input
,
60 int usestd3asciirules
);
62 extern int idna_to_ascii_from_utf8 (const char *input
,
65 int usestd3asciirules
);
67 extern int idna_to_ascii_from_locale (const char *input
,
70 int usestd3asciirules
);
72 extern int idna_to_unicode (const unsigned long *in
,
77 int usestd3asciirules
);
79 extern int idna_to_unicode_ucs4_from_ucs4 (const unsigned long *input
,
80 unsigned long **output
,
82 int usestd3asciirules
);
84 extern int idna_to_unicode_ucs4_from_utf8 (const char *input
,
85 unsigned long **output
,
87 int usestd3asciirules
);
89 extern int idna_to_unicode_utf8_from_utf8 (const char *input
,
92 int usestd3asciirules
);
94 extern int idna_to_unicode_locale_from_utf8 (const char *input
,
97 int usestd3asciirules
);
99 extern int idna_to_unicode_locale_from_locale (const char *input
,
102 int usestd3asciirules
);
104 /* Deprecated interfaces */
106 extern int idna_ucs4_to_ace (const unsigned long *input
, char **output
);
107 extern int idna_utf8_to_ace (const char *input
, char **output
);
108 extern int idna_locale_to_ace (const char *input
, char **output
);
110 extern int idna_ucs4ace_to_ucs4 (const unsigned long *input
,
111 unsigned long **output
);
112 extern int idna_utf8ace_to_ucs4 (const char *input
, unsigned long **output
);
113 extern int idna_utf8ace_to_utf8 (const char *input
, char **output
);
114 extern int idna_utf8ace_to_locale (const char *input
, char **output
);
115 extern int idna_localeace_to_locale (const char *input
, char **output
);
120 #endif /* _PUNYCODE_H */