test_class.declarator: logger = LoggerFactory.getLogger(MobileTextUtilTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger logger = LoggerFactory.getLogger(MobileTextUtilTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.file: ch-commons-charset/src/test/java/com/cloudhopper/commons/charset/MobileTextUtilTest.java
test_class.identifier: MobileTextUtilTest
test_case.body: @Test
      public void replaceSafeUnicodeChars() throws Exception {
          String source = null;
          StringBuilder buffer = null;
          int replaced = -1;
  
          source = "hello";
          buffer = new StringBuilder(source);
          replaced = MobileTextUtil.replaceSafeUnicodeChars(buffer);
          Assert.assertEquals(0, replaced);
          Assert.assertEquals(source, buffer.toString());
  
  
          source = "\u201chello\u201d \u201cworld\u201d \u201cthis\u201d";
          buffer = new StringBuilder(source);
          replaced = MobileTextUtil.replaceSafeUnicodeChars(buffer);
          Assert.assertEquals(6, replaced);
          Assert.assertEquals("\"hello\" \"world\" \"this\"", buffer.toString());
  
  
          source = "\u201chello\u201d \u201cworld\u201d \u201cthis\u201d";
          buffer = new StringBuilder(source);
          replaced = MobileTextUtil.replaceSafeUnicodeChars(buffer);
          Assert.assertEquals(6, replaced);
          Assert.assertEquals("\"hello\" \"world\" \"this\"", buffer.toString());
  
  
          source = "\u2018hello\u2019 \u2018world\u2019 don\u2019t";
          buffer = new StringBuilder(source);
          replaced = MobileTextUtil.replaceSafeUnicodeChars(buffer);
          Assert.assertEquals(5, replaced);
          Assert.assertEquals("\'hello\' \'world\' don\'t", buffer.toString());
      }
test_case.class_method_signature: MobileTextUtilTest.replaceSafeUnicodeChars()
test_case.full_signature: @Test public void replaceSafeUnicodeChars()
test_case.identifier: replaceSafeUnicodeChars
test_case.invocations: replaceSafeUnicodeChars assertEquals assertEquals toString replaceSafeUnicodeChars assertEquals assertEquals toString replaceSafeUnicodeChars assertEquals assertEquals toString replaceSafeUnicodeChars assertEquals assertEquals toString
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void replaceSafeUnicodeChars()
focal_class.declarator: CHAR_TABLE = {
          { '\u2013', '-' },
          { '\u2014', '-' },
          { '\u2018', '\'' },
          { '\u2019', '\'' },
          { '\u201A', '\'' },
          { '\u201B', '\'' }, // U+201B ‛​ single high-reversed-9 quotation mark (HTML: &#8219; ), also called single reversed comma, quotation mark 
          { '\u201C', '"' },
          { '\u201D', '"' },
          { '\u201E', '"' },
          { '\u201F', '"' }, // U+201F ‟​ double high-reversed-9 quotation mark (HTML: &#8223; ), also called double reversed comma, quotation mark
          { '\u2020', '+' },
          { '\u2022', '.' },
          { '\u2026', '.' }, // actually "...", but just replacing with "."
          { '\u2039', '<' },
          { '\u203A', '>' },
          /** deprecated at recommendation by Turkcell - these replacements changed meaning too much */
          //{ '\u0131', '1' }, // U+0131 is a lower case letter dotless i (ı)
          //{ '\u0130', 'i' }, // U+0130 (İ) is capital i with dot
      }
focal_class.modifier: static public final
focal_class.original_string: static public final char[][] CHAR_TABLE = {
          { '\u2013', '-' },
          { '\u2014', '-' },
          { '\u2018', '\'' },
          { '\u2019', '\'' },
          { '\u201A', '\'' },
          { '\u201B', '\'' }, // U+201B ‛​ single high-reversed-9 quotation mark (HTML: &#8219; ), also called single reversed comma, quotation mark 
          { '\u201C', '"' },
          { '\u201D', '"' },
          { '\u201E', '"' },
          { '\u201F', '"' }, // U+201F ‟​ double high-reversed-9 quotation mark (HTML: &#8223; ), also called double reversed comma, quotation mark
          { '\u2020', '+' },
          { '\u2022', '.' },
          { '\u2026', '.' }, // actually "...", but just replacing with "."
          { '\u2039', '<' },
          { '\u203A', '>' },
          /** deprecated at recommendation by Turkcell - these replacements changed meaning too much */
          //{ '\u0131', '1' }, // U+0131 is a lower case letter dotless i (ı)
          //{ '\u0130', 'i' }, // U+0130 (İ) is capital i with dot
      };
focal_class.type: char[][]
focal_class.var_name: CHAR_TABLE
focal_class.file: ch-commons-charset/src/main/java/com/cloudhopper/commons/charset/MobileTextUtil.java
focal_class.identifier: MobileTextUtil
focal_class.class_method_signature: MobileTextUtil.replaceSafeUnicodeChars(StringBuilder buffer)
focal_class.full_signature: static public int replaceSafeUnicodeChars(StringBuilder buffer)
focal_class.identifier: replaceSafeUnicodeChars
focal_class.modifiers: static public
focal_class.parameters: (StringBuilder buffer)
focal_class.return: int
focal_class.signature: int replaceSafeUnicodeChars(StringBuilder buffer)
focal_class.class_method_signature: MobileTextUtil.replaceAccentedChars(StringBuilder buffer)
focal_class.full_signature: public static int replaceAccentedChars(StringBuilder buffer)
focal_class.identifier: replaceAccentedChars
focal_class.modifiers: public static
focal_class.parameters: (StringBuilder buffer)
focal_class.return: int
focal_class.signature: int replaceAccentedChars(StringBuilder buffer)
focal_method.body: static public int replaceSafeUnicodeChars(StringBuilder buffer) {
          int replaced = 0;
          for (int i = 0; i < buffer.length(); i++) {
              char c = buffer.charAt(i);
              for (int j = 0; j < CHAR_TABLE.length; j++) {
                  if (c == CHAR_TABLE[j][0]) {
                      replaced++;
                      buffer.setCharAt(i, CHAR_TABLE[j][1]);
                  }
              }
          }
          return replaced;
      }
focal_method.class_method_signature: MobileTextUtil.replaceSafeUnicodeChars(StringBuilder buffer)
focal_method.full_signature: static public int replaceSafeUnicodeChars(StringBuilder buffer)
focal_method.identifier: replaceSafeUnicodeChars
focal_method.invocations: length charAt setCharAt
focal_method.modifiers: static public
focal_method.parameters: (StringBuilder buffer)
focal_method.return: int
focal_method.signature: int replaceSafeUnicodeChars(StringBuilder buffer)