Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: source/common/unicode/uidna.h

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/common/unicode/uconfig.h ('k') | source/common/unicode/ulistformatter.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ******************************************************************************* 2 *******************************************************************************
3 * 3 *
4 * Copyright (C) 2003-2013, International Business Machines 4 * Copyright (C) 2003-2014, International Business Machines
5 * Corporation and others. All Rights Reserved. 5 * Corporation and others. All Rights Reserved.
6 * 6 *
7 ******************************************************************************* 7 *******************************************************************************
8 * file name: uidna.h 8 * file name: uidna.h
9 * encoding: US-ASCII 9 * encoding: US-ASCII
10 * tab size: 8 (not used) 10 * tab size: 8 (not used)
11 * indentation:4 11 * indentation:4
12 * 12 *
13 * created on: 2003feb1 13 * created on: 2003feb1
14 * created by: Ram Viswanadha 14 * created by: Ram Viswanadha
(...skipping 10 matching lines...) Expand all
25 #include "unicode/parseerr.h" 25 #include "unicode/parseerr.h"
26 26
27 /** 27 /**
28 * \file 28 * \file
29 * \brief C API: Internationalizing Domain Names in Applications (IDNA) 29 * \brief C API: Internationalizing Domain Names in Applications (IDNA)
30 * 30 *
31 * IDNA2008 is implemented according to UTS #46, see the IDNA C++ class in idna. h. 31 * IDNA2008 is implemented according to UTS #46, see the IDNA C++ class in idna. h.
32 * 32 *
33 * The C API functions which do take a UIDNA * service object pointer 33 * The C API functions which do take a UIDNA * service object pointer
34 * implement UTS #46 and IDNA2008. 34 * implement UTS #46 and IDNA2008.
35 *
36 * IDNA2003 is obsolete.
35 * The C API functions which do not take a service object pointer 37 * The C API functions which do not take a service object pointer
36 * implement IDNA2003. 38 * implement IDNA2003. They are all deprecated.
37 */ 39 */
38 40
39 /* 41 /*
40 * IDNA option bit set values. 42 * IDNA option bit set values.
41 */ 43 */
42 enum { 44 enum {
43 /** 45 /**
44 * Default options value: None of the other options are set. 46 * Default options value: None of the other options are set.
45 * For use in static worker and factory methods. 47 * For use in static worker and factory methods.
46 * @stable ICU 2.6 48 * @stable ICU 2.6
47 */ 49 */
48 UIDNA_DEFAULT=0, 50 UIDNA_DEFAULT=0,
51 #ifndef U_HIDE_DEPRECATED_API
49 /** 52 /**
50 * Option to allow unassigned code points in domain names and labels. 53 * Option to allow unassigned code points in domain names and labels.
51 * For use in static worker and factory methods. 54 * For use in static worker and factory methods.
52 * <p>This option is ignored by the UTS46 implementation. 55 * <p>This option is ignored by the UTS46 implementation.
53 * (UTS #46 disallows unassigned code points.) 56 * (UTS #46 disallows unassigned code points.)
54 * @stable ICU 2.6 57 * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDN A.
55 */ 58 */
56 UIDNA_ALLOW_UNASSIGNED=1, 59 UIDNA_ALLOW_UNASSIGNED=1,
60 #endif /* U_HIDE_DEPRECATED_API */
57 /** 61 /**
58 * Option to check whether the input conforms to the STD3 ASCII rules, 62 * Option to check whether the input conforms to the STD3 ASCII rules,
59 * for example the restriction of labels to LDH characters 63 * for example the restriction of labels to LDH characters
60 * (ASCII Letters, Digits and Hyphen-Minus). 64 * (ASCII Letters, Digits and Hyphen-Minus).
61 * For use in static worker and factory methods. 65 * For use in static worker and factory methods.
62 * @stable ICU 2.6 66 * @stable ICU 2.6
63 */ 67 */
64 UIDNA_USE_STD3_RULES=2, 68 UIDNA_USE_STD3_RULES=2,
65 /** 69 /**
66 * IDNA option to check for whether the input conforms to the BiDi rules. 70 * IDNA option to check for whether the input conforms to the BiDi rules.
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 */ 500 */
497 UIDNA_ERROR_CONTEXTO_PUNCTUATION=0x2000, 501 UIDNA_ERROR_CONTEXTO_PUNCTUATION=0x2000,
498 /** 502 /**
499 * A label does not meet the IDNA CONTEXTO requirements for digits. 503 * A label does not meet the IDNA CONTEXTO requirements for digits.
500 * Arabic-Indic Digits (U+066x) must not be mixed with Extended Arabic-Indic Digits (U+06Fx). 504 * Arabic-Indic Digits (U+066x) must not be mixed with Extended Arabic-Indic Digits (U+06Fx).
501 * @stable ICU 49 505 * @stable ICU 49
502 */ 506 */
503 UIDNA_ERROR_CONTEXTO_DIGITS=0x4000 507 UIDNA_ERROR_CONTEXTO_DIGITS=0x4000
504 }; 508 };
505 509
510 #ifndef U_HIDE_DEPRECATED_API
511
506 /* IDNA2003 API ------------------------------------------------------------- */ 512 /* IDNA2003 API ------------------------------------------------------------- */
507 513
508 /** 514 /**
509 * IDNA2003: This function implements the ToASCII operation as defined in the ID NA RFC. 515 * IDNA2003: This function implements the ToASCII operation as defined in the ID NA RFC.
510 * This operation is done on <b>single labels</b> before sending it to something that expects 516 * This operation is done on <b>single labels</b> before sending it to something that expects
511 * ASCII names. A label is an individual part of a domain name. Labels are usual ly 517 * ASCII names. A label is an individual part of a domain name. Labels are usual ly
512 * separated by dots; e.g. "www.example.com" is composed of 3 labels "www","exam ple", and "com". 518 * separated by dots; e.g. "www.example.com" is composed of 3 labels "www","exam ple", and "com".
513 * 519 *
514 * IDNA2003 API Overview: 520 * IDNA2003 API Overview:
515 * 521 *
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 * @param parseError Pointer to UParseError struct to receive information on position 561 * @param parseError Pointer to UParseError struct to receive information on position
556 * of error if an error is encountered. Can be NULL. 562 * of error if an error is encountered. Can be NULL.
557 * @param status ICU in/out error code parameter. 563 * @param status ICU in/out error code parameter.
558 * U_INVALID_CHAR_FOUND if src contains 564 * U_INVALID_CHAR_FOUND if src contains
559 * unmatched single surrogates. 565 * unmatched single surrogates.
560 * U_INDEX_OUTOFBOUNDS_ERROR if src contains 566 * U_INDEX_OUTOFBOUNDS_ERROR if src contains
561 * too many code points. 567 * too many code points.
562 * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enoug h 568 * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enoug h
563 * @return The length of the result string, if successful - or in case of a buff er overflow, 569 * @return The length of the result string, if successful - or in case of a buff er overflow,
564 * in which case it will be greater than destCapacity. 570 * in which case it will be greater than destCapacity.
565 * @stable ICU 2.6 571 * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
566 */ 572 */
567 U_STABLE int32_t U_EXPORT2 573 U_DEPRECATED int32_t U_EXPORT2
568 uidna_toASCII(const UChar* src, int32_t srcLength, 574 uidna_toASCII(const UChar* src, int32_t srcLength,
569 UChar* dest, int32_t destCapacity, 575 UChar* dest, int32_t destCapacity,
570 int32_t options, 576 int32_t options,
571 UParseError* parseError, 577 UParseError* parseError,
572 UErrorCode* status); 578 UErrorCode* status);
573 579
574 580
575 /** 581 /**
576 * IDNA2003: This function implements the ToUnicode operation as defined in the IDNA RFC. 582 * IDNA2003: This function implements the ToUnicode operation as defined in the IDNA RFC.
577 * This operation is done on <b>single labels</b> before sending it to something that expects 583 * This operation is done on <b>single labels</b> before sending it to something that expects
(...skipping 25 matching lines...) Expand all
603 * @param parseError Pointer to UParseError struct to receive information on position 609 * @param parseError Pointer to UParseError struct to receive information on position
604 * of error if an error is encountered. Can be NULL. 610 * of error if an error is encountered. Can be NULL.
605 * @param status ICU in/out error code parameter. 611 * @param status ICU in/out error code parameter.
606 * U_INVALID_CHAR_FOUND if src contains 612 * U_INVALID_CHAR_FOUND if src contains
607 * unmatched single surrogates. 613 * unmatched single surrogates.
608 * U_INDEX_OUTOFBOUNDS_ERROR if src contains 614 * U_INDEX_OUTOFBOUNDS_ERROR if src contains
609 * too many code points. 615 * too many code points.
610 * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enoug h 616 * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enoug h
611 * @return The length of the result string, if successful - or in case of a buff er overflow, 617 * @return The length of the result string, if successful - or in case of a buff er overflow,
612 * in which case it will be greater than destCapacity. 618 * in which case it will be greater than destCapacity.
613 * @stable ICU 2.6 619 * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
614 */ 620 */
615 U_STABLE int32_t U_EXPORT2 621 U_DEPRECATED int32_t U_EXPORT2
616 uidna_toUnicode(const UChar* src, int32_t srcLength, 622 uidna_toUnicode(const UChar* src, int32_t srcLength,
617 UChar* dest, int32_t destCapacity, 623 UChar* dest, int32_t destCapacity,
618 int32_t options, 624 int32_t options,
619 UParseError* parseError, 625 UParseError* parseError,
620 UErrorCode* status); 626 UErrorCode* status);
621 627
622 628
623 /** 629 /**
624 * IDNA2003: Convenience function that implements the IDNToASCII operation as de fined in the IDNA RFC. 630 * IDNA2003: Convenience function that implements the IDNToASCII operation as de fined in the IDNA RFC.
625 * This operation is done on complete domain names, e.g: "www.example.com". 631 * This operation is done on complete domain names, e.g: "www.example.com".
(...skipping 28 matching lines...) Expand all
654 * @param parseError Pointer to UParseError struct to receive information on position 660 * @param parseError Pointer to UParseError struct to receive information on position
655 * of error if an error is encountered. Can be NULL. 661 * of error if an error is encountered. Can be NULL.
656 * @param status ICU in/out error code parameter. 662 * @param status ICU in/out error code parameter.
657 * U_INVALID_CHAR_FOUND if src contains 663 * U_INVALID_CHAR_FOUND if src contains
658 * unmatched single surrogates. 664 * unmatched single surrogates.
659 * U_INDEX_OUTOFBOUNDS_ERROR if src contains 665 * U_INDEX_OUTOFBOUNDS_ERROR if src contains
660 * too many code points. 666 * too many code points.
661 * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enoug h 667 * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enoug h
662 * @return The length of the result string, if successful - or in case of a buff er overflow, 668 * @return The length of the result string, if successful - or in case of a buff er overflow,
663 * in which case it will be greater than destCapacity. 669 * in which case it will be greater than destCapacity.
664 * @stable ICU 2.6 670 * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
665 */ 671 */
666 U_STABLE int32_t U_EXPORT2 672 U_DEPRECATED int32_t U_EXPORT2
667 uidna_IDNToASCII( const UChar* src, int32_t srcLength, 673 uidna_IDNToASCII( const UChar* src, int32_t srcLength,
668 UChar* dest, int32_t destCapacity, 674 UChar* dest, int32_t destCapacity,
669 int32_t options, 675 int32_t options,
670 UParseError* parseError, 676 UParseError* parseError,
671 UErrorCode* status); 677 UErrorCode* status);
672 678
673 /** 679 /**
674 * IDNA2003: Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC. 680 * IDNA2003: Convenience function that implements the IDNToUnicode operation as defined in the IDNA RFC.
675 * This operation is done on complete domain names, e.g: "www.example.com". 681 * This operation is done on complete domain names, e.g: "www.example.com".
676 * 682 *
(...skipping 24 matching lines...) Expand all
701 * @param parseError Pointer to UParseError struct to receive information on position 707 * @param parseError Pointer to UParseError struct to receive information on position
702 * of error if an error is encountered. Can be NULL. 708 * of error if an error is encountered. Can be NULL.
703 * @param status ICU in/out error code parameter. 709 * @param status ICU in/out error code parameter.
704 * U_INVALID_CHAR_FOUND if src contains 710 * U_INVALID_CHAR_FOUND if src contains
705 * unmatched single surrogates. 711 * unmatched single surrogates.
706 * U_INDEX_OUTOFBOUNDS_ERROR if src contains 712 * U_INDEX_OUTOFBOUNDS_ERROR if src contains
707 * too many code points. 713 * too many code points.
708 * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enoug h 714 * U_BUFFER_OVERFLOW_ERROR if destCapacity is not enoug h
709 * @return The length of the result string, if successful - or in case of a buff er overflow, 715 * @return The length of the result string, if successful - or in case of a buff er overflow,
710 * in which case it will be greater than destCapacity. 716 * in which case it will be greater than destCapacity.
711 * @stable ICU 2.6 717 * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
712 */ 718 */
713 U_STABLE int32_t U_EXPORT2 719 U_DEPRECATED int32_t U_EXPORT2
714 uidna_IDNToUnicode( const UChar* src, int32_t srcLength, 720 uidna_IDNToUnicode( const UChar* src, int32_t srcLength,
715 UChar* dest, int32_t destCapacity, 721 UChar* dest, int32_t destCapacity,
716 int32_t options, 722 int32_t options,
717 UParseError* parseError, 723 UParseError* parseError,
718 UErrorCode* status); 724 UErrorCode* status);
719 725
720 /** 726 /**
721 * IDNA2003: Compare two IDN strings for equivalence. 727 * IDNA2003: Compare two IDN strings for equivalence.
722 * This function splits the domain names into labels and compares them. 728 * This function splits the domain names into labels and compares them.
723 * According to IDN RFC, whenever two labels are compared, they are 729 * According to IDN RFC, whenever two labels are compared, they are
(...skipping 18 matching lines...) Expand all
742 * If this option is set, the unassigned code point s are in the input 748 * If this option is set, the unassigned code point s are in the input
743 * are treated as normal Unicode code points. 749 * are treated as normal Unicode code points.
744 * 750 *
745 * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restri ctions 751 * - UIDNA_USE_STD3_RULES Use STD3 ASCII rules for host name syntax restri ctions
746 * If this option is set and the input does not sat isfy STD3 rules, 752 * If this option is set and the input does not sat isfy STD3 rules,
747 * the operation will fail with U_IDNA_STD3_ASCII_R ULES_ERROR 753 * the operation will fail with U_IDNA_STD3_ASCII_R ULES_ERROR
748 * 754 *
749 * @param status ICU error code in/out parameter. 755 * @param status ICU error code in/out parameter.
750 * Must fulfill U_SUCCESS before the function call. 756 * Must fulfill U_SUCCESS before the function call.
751 * @return <0 or 0 or >0 as usual for string comparisons 757 * @return <0 or 0 or >0 as usual for string comparisons
752 * @stable ICU 2.6 758 * @deprecated ICU 55 Use UTS #46 instead via uidna_openUTS46() or class IDNA.
753 */ 759 */
754 U_STABLE int32_t U_EXPORT2 760 U_DEPRECATED int32_t U_EXPORT2
755 uidna_compare( const UChar *s1, int32_t length1, 761 uidna_compare( const UChar *s1, int32_t length1,
756 const UChar *s2, int32_t length2, 762 const UChar *s2, int32_t length2,
757 int32_t options, 763 int32_t options,
758 UErrorCode* status); 764 UErrorCode* status);
759 765
766 #endif /* U_HIDE_DEPRECATED_API */
767
760 #endif /* #if !UCONFIG_NO_IDNA */ 768 #endif /* #if !UCONFIG_NO_IDNA */
761 769
762 #endif 770 #endif
OLDNEW
« no previous file with comments | « source/common/unicode/uconfig.h ('k') | source/common/unicode/ulistformatter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698