Java Code Examples for sun.text.Normalizer#normalize()

The following examples show how to use sun.text.Normalizer#normalize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StringPrep.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 2
Source File: StringPrep.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 3
Source File: StringPrep.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 4
Source File: StringPrep.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 5
Source File: StringPrep.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 6
Source File: StringPrep.java    From Bytecoder with Apache License 2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2));
}
 
Example 7
Source File: StringPrep.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2));
}
 
Example 8
Source File: StringPrep.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 9
Source File: StringPrep.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 10
Source File: StringPrep.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 11
Source File: StringPrep.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 12
Source File: StringPrep.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 13
Source File: StringPrep.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}
 
Example 14
Source File: StringPrep.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private StringBuffer normalize(StringBuffer src){
    /*
     * Option UNORM_BEFORE_PRI_29:
     *
     * IDNA as interpreted by IETF members (see unicode mailing list 2004H1)
     * requires strict adherence to Unicode 3.2 normalization,
     * including buggy composition from before fixing Public Review Issue #29.
     * Note that this results in some valid but nonsensical text to be
     * either corrupted or rejected, depending on the text.
     * See http://www.unicode.org/review/resolved-pri.html#pri29
     * See unorm.cpp and cnormtst.c
     */
    return new StringBuffer(
        Normalizer.normalize(
            src.toString(),
            java.text.Normalizer.Form.NFKC,
            Normalizer.UNICODE_3_2|NormalizerImpl.BEFORE_PRI_29));
}