code: 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;
      }
docs: Replace unicode characters with their ascii equivalents, limiting
  replacement to "safe" characters such as smart quotes to dumb quotes.
  "Safe" is subjective, but generally the agreement is that these character
  replacements should not change the meaning of the string in any meaninful
  way.
  
  @param buffer The buffer containing the characters to analyze and replace
  if necessary.
  @return The number of characters replaced