Add given chars to char set
975703
def add_chars(self, chars):
        ''
        for c in chars:
            if self._ignorecase:
                self._whitelist_chars.add(c.lower())
                self._whitelist_chars.add(c.upper())
            else:
                self._whitelist_chars.add(c)
864572
@Override
  public Character set(int index, Character element) {
    return set(index, element.charValue());
  }
883358
public void put(char []key, int length, int value)
  {
    if (key == null)
      return;

    int hash = hash(key, length) & _mask;

    while (true) {
      char []testKey = _keys[hash];

      if (testKey == null || equals(testKey, key, length)) {
        _keys[hash] = new char[length];

        for (int i = length - 1; i >= 0; i--) {
          char ch = key[i];

          if ('A' <= ch && ch <= 'Z')
            ch += 'a' - 'A';

          _keys[hash][i] = ch;
        }

        _values[hash] = value;

        _size++;

        if (_keys.length <= 4 * _size)
          resize(2 * _keys.length);

        return;
      }
      else if (key != testKey && ! testKey.equals(key)) {
        hash = (hash + 1) & _mask;
        continue;
      }
      else {
        _values[hash] = value;

        return;
      }
    }
  }
1090373
def substitution_set(string, indexes):
    
    strlen = len(string)
    return {mutate_string(string, x) for x in indexes if valid_substitution(strlen, x)}
1093580
public IStringBuffer append( char[] chars, int start )
    {
        append(chars, start, chars.length - start);
        return this;
    }
832006
public static Characters allBut(char... chars) {
        return chars.length == 0 ? Characters.ALL : new Characters(true, chars.clone());
    }
1340396
private byte[] toByteArray(char[] chars, Charset charset) {
        assert chars != null;

        CharBuffer charBuffer = CharBuffer.wrap(chars);
        ByteBuffer byteBuffer = charset.encode(charBuffer);
        byte[] bytes = Arrays.copyOfRange(byteBuffer.array(),
                byteBuffer.position(), byteBuffer.limit());
        Arrays.fill(byteBuffer.array(), (byte) 0); // clear sensitive data
        return bytes;
    }
965350
function getNewChars(key, characterSet) {
  const cachedFontAtlas = cache.get(key);
  if (!cachedFontAtlas) {
    return characterSet;
  }

  const newChars = [];
  const cachedMapping = cachedFontAtlas.mapping;
  let cachedCharSet = Object.keys(cachedMapping);
  cachedCharSet = new Set(cachedCharSet);

  let charSet = characterSet;
  if (charSet instanceof Array) {
    charSet = new Set(charSet);
  }

  charSet.forEach(char => {
    if (!cachedCharSet.has(char)) {
      newChars.push(char);
    }
  });

  return newChars;
}
959028
public void setCharset(String to) {
    // Validate the character set.
    try {
      new String(new byte[97], to);
    } catch (UnsupportedEncodingException e) {
      throw new RuntimeException(e);
    }
    charset = to;
  }
1368958
private static void _smartAppend(StringBuilder buf, char c) {
        if (buf.length() != 0 &&
            buf.charAt(buf.length() - 1) != c) {
            buf.append(c);
        }
    }
1128678
public void put(final String keys, final P value) {
        if (keys.matches(".*" + SIMPLE_CHARACTER_CLASS + ".*")) {
            int charClassStart = keys.indexOf('[', 0);
            final int charClassEnd = keys.indexOf(']', 1);
            String begin = keys.substring(0, charClassStart);
            for (; charClassStart < charClassEnd - 1; charClassStart++) {
                char middle = keys.charAt(charClassStart + 1);
                String end = keys.substring(charClassEnd + 1, keys.length());
                put(begin + middle + end, value);
            }
        } else
            trie.put(keys, value);
    }
1165644
def _add_from_str(self, s):
        """"""

        if sys.version_info[0] < 3 and isinstance(s, str):
            s = s.decode('utf-8')

        for line in s.split("\n"):
            self._parse_line(line)
802353
public FilterByteBuffer putString(String str, Charset charset) throws IOException
    {
        byte[] bytes = str.getBytes(charset);
        put(bytes).put((byte)0);
        return this;
    }
359391
public void setCharset(final String charset) {
		try {
			this.charset = Charset.forName(charset);
		} catch (UnsupportedCharsetException ex) {
			this.charset = StandardCharsets.UTF_8;
			LOG.error("The specified character set could not be converted to {}. Set the default character set({}).",
					charset, this.charset);
		}
	}
958426
private final void setto(String s) {
        int l = s.length();
        int o = j + 1;
        for (int i = 0; i < l; i++) {
            b[o + i] = s.charAt(i);
        }
        k = j + l;
    }
1119158
public void append(final char ch) {
        final int newlen = this.len + 1;
        if (newlen > this.array.length) {
            expand(newlen);
        }
        this.array[this.len] = ch;
        this.len = newlen;
    }
819226
public void append(char c[], int off, int len) {
	int restLength = buffer.length - pos;
	if (len < restLength) {
	    System.arraycopy(c, off, buffer, pos, len);
	    pos += len;
	}
	else {
	    System.arraycopy(c, off, buffer, pos, restLength);
	    curr.next = new Entity(buffer);
	    curr = curr.next;
	    length += buffer.length;
	    buffer = new char[(buffer.length > len - restLength) ? buffer.length : len - restLength];

	    System.arraycopy(c, off + restLength, buffer, 0, len - restLength);
	    pos = len - restLength;

	}
    }