/**
 * Copyright (C) 2000 - 2009 Silverpeas
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * As a special exception to the terms and conditions of version 3.0 of
 * the GPL, you may redistribute this Program in connection with Free/Libre
 * Open Source Software ("FLOSS") applications as described in Silverpeas's
 * FLOSS exception.  You should have recieved a copy of the text describing
 * the FLOSS exception, and it is also available here:
 * "http://repository.silverpeas.com/legal/licensing"
 *
 * This program 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.silverpeas.tagcloud.model;

/**
 * Utilities class. Used to generate the correct spelling for the tag of a
 * tagcloud.
 */
public class TagCloudUtil {

  // List of characters used to generate a correct tag.
  // For each line, the characters contained in the first string has to be
  // replaced by the
  // character of the second string.
  private static final String[][] TAG_DATA = { { "(Ç)", "C" },
      { "(À|?|Â|Ã|Ä|Å|Æ)", "A" }, { "(È|É|Ê|Ë)", "E" },
      { "(Ì|?|Î|?)", "I" }, { "(Ò|Ó|Ô|Õ|Ö)", "O" },
      { "(Ù|Ú|Û|Ü)", "U" }, { "(?)", "Y" } };

  /**
   * @param s
   *          The string to convert into a valid tag.
   * @return The tag corresponding to the string given as parameter.
   */
  public static String getTag(String s) {
    s = s.toUpperCase();
    for (int i = 0, n = TAG_DATA.length; i < n; i++) {
      s = s.replaceAll(TAG_DATA[i][0], TAG_DATA[i][1]);
    }
    return s;
  }

}
@@ -1567,9 +1567,10 @@
 %7B %22(
-%C3%87
+%C3%83%E2%80%A1
 )%22, 
@@ -1591,21 +1591,28 @@
 %7B %22(
-%C3%80%7C?%7C%C3%82%7C%C3%83%7C%C3%84%7C%C3%85%7C%C3%86
+%C3%83%E2%82%AC%7C%C3%83?%7C%C3%83%E2%80%9A%7C%C3%83%C6%92%7C%C3%83%E2%80%9E%7C%C3%83%E2%80%A6%7C%C3%83%E2%80%A0
 )%22, 
@@ -1626,15 +1626,19 @@
 %7B %22(
-%C3%88%7C%C3%89%7C%C3%8A%7C%C3%8B
+%C3%83%CB%86%7C%C3%83%E2%80%B0%7C%C3%83%C5%A0%7C%C3%83%E2%80%B9
 )%22, 
@@ -1659,14 +1659,18 @@
 %7B %22(
-%C3%8C%7C?%7C%C3%8E%7C
+%C3%83%C5%92%7C%C3%83?%7C%C3%83%C5%BD%7C%C3%83
 ?)%22,
@@ -1685,17 +1685,22 @@
 %7B %22(
-%C3%92%7C%C3%93%7C%C3%94%7C%C3%95%7C%C3%96
+%C3%83%E2%80%99%7C%C3%83%E2%80%9C%7C%C3%83%E2%80%9D%7C%C3%83%E2%80%A2%7C%C3%83%E2%80%93
 )%22, 
@@ -1721,15 +1721,19 @@
 %7B %22(
-%C3%99%7C%C3%9A%7C%C3%9B%7C%C3%9C
+%C3%83%E2%84%A2%7C%C3%83%C5%A1%7C%C3%83%E2%80%BA%7C%C3%83%C5%93
 )%22, 
@@ -1743,16 +1743,17 @@
  %7D, %7B %22(
+%C3%83
 ?)%22, %22Y%22

UTF-8 problem