Java String Normalize normalizeUnicode(CharSequence text)

Here you can find the source of normalizeUnicode(CharSequence text)

Description

Apply Unicode NFC normalization to a string.

License

Open Source License

Declaration

public static String normalizeUnicode(CharSequence text) 

Method Source Code

//package com.java2s;
/* *************************************************************************
 *
 *  TMPotter - Bi-text Aligner/TMX Editor
 *
 *  Copyright (C) 2015 Hiroshi Miura//from  www. j a v  a 2  s.c o  m
 *
 *  This file come from OmegaT project
 * 
 *  Copyright (C) 2007 - Zoltan Bartko
 *                2011 Alex Buloichik
 *
 *  This file is part of TMPotter.
 *
 *  TMPotter is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  TMPotter is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with TMPotter.  If not, see http://www.gnu.org/licenses/.
 *
 * *************************************************************************/

import java.text.Normalizer;

public class Main {
    /**
     * Apply Unicode NFC normalization to a string.
     */
    public static String normalizeUnicode(CharSequence text) {
        return Normalizer.isNormalized(text, Normalizer.Form.NFC) ? text.toString()
                : Normalizer.normalize(text, Normalizer.Form.NFC);
    }
}

Related

  1. normalizeString(String token)
  2. normalizeSuffix(String suffix)
  3. normalizeTestAndSplit(String text)
  4. normalizeTibetan(String s)
  5. normalizeToAlpha(String input)
  6. normalizeUnicode(final String str)
  7. normalizeUnicode(String input)
  8. normalizeUnicode(String str)
  9. normalizeUnicodeDiacritics(String text)