/*
*******************************************************************************
*
- * Copyright (C) 2003-2012, International Business Machines
+ * Copyright (C) 2003-2014, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
*
* The C API functions which do take a UIDNA * service object pointer
* implement UTS #46 and IDNA2008.
+ *
+ * IDNA2003 is obsolete.
* The C API functions which do not take a service object pointer
- * implement IDNA2003.
+ * implement IDNA2003. They are all deprecated.
*/
/*
* @stable ICU 2.6
*/
UIDNA_DEFAULT=0,
+#ifndef U_HIDE_DEPRECATED_API
/**
* Option to allow unassigned code points in domain names and labels.
* For use in static worker and factory methods.
* <p>This option is ignored by the UTS46 implementation.
* (UTS #46 disallows unassigned code points.)
- * @stable ICU 2.6
+ * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
*/
UIDNA_ALLOW_UNASSIGNED=1,
+#endif /* U_HIDE_DEPRECATED_API */
/**
* Option to check whether the input conforms to the STD3 ASCII rules,
* for example the restriction of labels to LDH characters
* @stable ICU 4.6
*/
UIDNA_NONTRANSITIONAL_TO_UNICODE=0x20,
-#ifndef U_HIDE_DRAFT_API
/**
* IDNA option to check for whether the input conforms to the CONTEXTO rules.
* For use in static worker and factory methods.
* (The CONTEXTO check is new in IDNA2008.)
* <p>This is for use by registries for IDNA2008 conformance.
* UTS #46 does not require the CONTEXTO check.
- * @draft ICU 49
+ * @stable ICU 49
*/
UIDNA_CHECK_CONTEXTO=0x40
-#endif /* U_HIDE_DRAFT_API */
};
/**
* @return the UTS #46 UIDNA instance, if successful
* @stable ICU 4.6
*/
-U_DRAFT UIDNA * U_EXPORT2
+U_STABLE UIDNA * U_EXPORT2
uidna_openUTS46(uint32_t options, UErrorCode *pErrorCode);
/**
* @param idna UIDNA instance to be closed
* @stable ICU 4.6
*/
-U_DRAFT void U_EXPORT2
+U_STABLE void U_EXPORT2
uidna_close(UIDNA *idna);
#if U_SHOW_CPLUSPLUS_API
* \endcode
* @stable ICU 4.6
*/
-struct UIDNAInfo {
+typedef struct UIDNAInfo {
/** sizeof(UIDNAInfo) @stable ICU 4.6 */
int16_t size;
/**
uint32_t errors;
int32_t reservedI2; /**< Reserved field, do not use. @internal */
int32_t reservedI3; /**< Reserved field, do not use. @internal */
-};
-typedef struct UIDNAInfo UIDNAInfo;
+} UIDNAInfo;
/**
* Static initializer for a UIDNAInfo struct.
* @return destination string length
* @stable ICU 4.6
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uidna_labelToASCII(const UIDNA *idna,
const UChar *label, int32_t length,
UChar *dest, int32_t capacity,
* @return destination string length
* @stable ICU 4.6
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uidna_labelToUnicode(const UIDNA *idna,
const UChar *label, int32_t length,
UChar *dest, int32_t capacity,
* @return destination string length
* @stable ICU 4.6
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uidna_nameToASCII(const UIDNA *idna,
const UChar *name, int32_t length,
UChar *dest, int32_t capacity,
* @return destination string length
* @stable ICU 4.6
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uidna_nameToUnicode(const UIDNA *idna,
const UChar *name, int32_t length,
UChar *dest, int32_t capacity,
* @return destination string length
* @stable ICU 4.6
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uidna_labelToASCII_UTF8(const UIDNA *idna,
const char *label, int32_t length,
char *dest, int32_t capacity,
* @return destination string length
* @stable ICU 4.6
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uidna_labelToUnicodeUTF8(const UIDNA *idna,
const char *label, int32_t length,
char *dest, int32_t capacity,
* @return destination string length
* @stable ICU 4.6
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uidna_nameToASCII_UTF8(const UIDNA *idna,
const char *name, int32_t length,
char *dest, int32_t capacity,
* @return destination string length
* @stable ICU 4.6
*/
-U_DRAFT int32_t U_EXPORT2
+U_STABLE int32_t U_EXPORT2
uidna_nameToUnicodeUTF8(const UIDNA *idna,
const char *name, int32_t length,
char *dest, int32_t capacity,
* @stable ICU 4.6
*/
UIDNA_ERROR_CONTEXTJ=0x1000,
-#ifndef U_HIDE_DRAFT_API
/**
* A label does not meet the IDNA CONTEXTO requirements for punctuation characters.
* Some punctuation characters "Would otherwise have been DISALLOWED"
* but are allowed in certain contexts. (RFC 5892)
- * @draft ICU 49
+ * @stable ICU 49
*/
UIDNA_ERROR_CONTEXTO_PUNCTUATION=0x2000,
/**
* A label does not meet the IDNA CONTEXTO requirements for digits.
* Arabic-Indic Digits (U+066x) must not be mixed with Extended Arabic-Indic Digits (U+06Fx).
- * @draft ICU 49
+ * @stable ICU 49
*/
UIDNA_ERROR_CONTEXTO_DIGITS=0x4000
-#endif /* U_HIDE_DRAFT_API */
};
+#ifndef U_HIDE_DEPRECATED_API
+
/* IDNA2003 API ------------------------------------------------------------- */
/**
* U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
* @return The length of the result string, if successful - or in case of a buffer overflow,
* in which case it will be greater than destCapacity.
- * @stable ICU 2.6
+ * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
*/
-U_STABLE int32_t U_EXPORT2
+U_DEPRECATED int32_t U_EXPORT2
uidna_toASCII(const UChar* src, int32_t srcLength,
UChar* dest, int32_t destCapacity,
int32_t options,
* U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
* @return The length of the result string, if successful - or in case of a buffer overflow,
* in which case it will be greater than destCapacity.
- * @stable ICU 2.6
+ * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
*/
-U_STABLE int32_t U_EXPORT2
+U_DEPRECATED int32_t U_EXPORT2
uidna_toUnicode(const UChar* src, int32_t srcLength,
UChar* dest, int32_t destCapacity,
int32_t options,
* U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
* @return The length of the result string, if successful - or in case of a buffer overflow,
* in which case it will be greater than destCapacity.
- * @stable ICU 2.6
+ * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
*/
-U_STABLE int32_t U_EXPORT2
+U_DEPRECATED int32_t U_EXPORT2
uidna_IDNToASCII( const UChar* src, int32_t srcLength,
UChar* dest, int32_t destCapacity,
int32_t options,
* U_BUFFER_OVERFLOW_ERROR if destCapacity is not enough
* @return The length of the result string, if successful - or in case of a buffer overflow,
* in which case it will be greater than destCapacity.
- * @stable ICU 2.6
+ * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
*/
-U_STABLE int32_t U_EXPORT2
+U_DEPRECATED int32_t U_EXPORT2
uidna_IDNToUnicode( const UChar* src, int32_t srcLength,
UChar* dest, int32_t destCapacity,
int32_t options,
* @param status ICU error code in/out parameter.
* Must fulfill U_SUCCESS before the function call.
* @return <0 or 0 or >0 as usual for string comparisons
- * @stable ICU 2.6
+ * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
*/
-U_STABLE int32_t U_EXPORT2
+U_DEPRECATED int32_t U_EXPORT2
uidna_compare( const UChar *s1, int32_t length1,
const UChar *s2, int32_t length2,
int32_t options,
UErrorCode* status);
+#endif /* U_HIDE_DEPRECATED_API */
+
#endif /* #if !UCONFIG_NO_IDNA */
#endif