Create a new {@link Contacts} instance that uses the given character agent to
make its HTTP requests to the ESI interface.

@param char The character access information
@returns An Contacts API instance
513879
function makeContacts(char) {
    function addContacts(watched, ids, standing, labelID) {
        return char.agent.request('post_characters_character_id_contacts', {
            path: { character_id: char.id },
            query: { watched: watched, standing: standing, label_id: labelID },
            body: ids
        }, char.ssoToken);
    }
    const allContacts = page_loader_1.makePageBasedLoader(page => char.agent.request('get_characters_character_id_contacts', { path: { character_id: char.id }, query: { page: page } }, char.ssoToken));
    let contacts = function (id) {
        if (id === undefined) {
            return allContacts.getAll();
        }
        else {
            return new ContactImpl(char, id);
        }
    };
    contacts.labels = function () {
        return char.agent.request('get_characters_character_id_contacts_labels', { path: { character_id: char.id } }, char.ssoToken);
    };
    contacts.add = function (ids, standing, labelID) {
        return addContacts(false, ids, standing, labelID);
    };
    contacts.addWatched = function (ids, standing, labelID) {
        return addContacts(true, ids, standing, labelID);
    };
    return contacts;
}
672058
private static char[][] addChar(FigletFont figletFont, char[][] char1, char[][] char2) {
    char[][] result = new char[figletFont.height][];
    int overlay = calculateOverlay(figletFont, char1, char2);
    for (int l = 0; l < figletFont.height; l++) {
      if(char1[l] == null) {
        char1[l] = new char[0];
      }
      char[] cs1 = char1[l];
      char[] cs2 = char2[l];
      int char1Length = cs1.length;
      int char2Length  = cs2.length;
      int k;
      for(k = 0; k < overlay && char1Length > 0; k++){
        int col = char1Length - overlay + k;
        char c2 = cs2[k];
        char c1 = cs1[col];
        char smushed = figletFont.smushingRulesToApply.smushHorizontal(c1, c2, figletFont.hardblank);
        cs1[col] = smushed;
      }
      char lineResult[] = new char[char1Length + char2Length-k];
      System.arraycopy(char1[l], 0, lineResult, 0, char1Length);
      System.arraycopy(char2[l], k, lineResult, char1Length, char2Length-k);
      result[l] = lineResult;
    }
    return result;
  }
1195880
protected EntityDecl getIntEntity(int ch, final char[] originalChars)
    {
        String cacheKey = new String(originalChars);

        IntEntity entity = mCachedEntities.get(cacheKey);
        if (entity == null) {
            String repl;
            if (ch <= 0xFFFF) {
                repl = Character.toString((char) ch);
            } else {
                StringBuffer sb = new StringBuffer(2);
                ch -= 0x10000;
                sb.append((char) ((ch >> 10)  + 0xD800));
                sb.append((char) ((ch & 0x3FF)  + 0xDC00));
                repl = sb.toString();
            }
            entity = IntEntity.create(new String(originalChars), repl);
            mCachedEntities.put(cacheKey, entity);
        }
        return entity;
    }
1319130
public static Characters of(char... chars) {
        return chars.length == 0 ? Characters.NONE : new Characters(false, chars.clone());
    }
335182
function makeColonies(char) {
    return function (id) {
        if (id === undefined) {
            return char.agent.request('get_characters_character_id_planets', { path: { character_id: char.id } }, char.ssoToken);
        }
        else {
            return new ColonyImpl(char, id);
        }
    };
}
310028
function makeCalendar(char) {
    let calendar = function (id) {
        if (id === undefined) {
            return calendar.history();
        }
        else {
            return new EventImpl(char, id);
        }
    };
    calendar.history = function (fromId) {
        return char.agent.request('get_characters_character_id_calendar', {
            path: { character_id: char.id }, query: { from_event: fromId }
        }, char.ssoToken);
    };
    return calendar;
}
1268514
public static ChannelNumberAttribute createChannelNumberAttribute(
			char channelNumber) {
		ChannelNumberAttribute attribute = new ChannelNumberAttribute();

		attribute.setChannelNumber(channelNumber);
		return attribute;
	}
1230671
public Character getCharacter(Class<?> aClass,String key,char defaultValue)
   {
	   String results = getText(aClass,key, "");
	   
	   if(results.length() == 0)
		   return Character.valueOf(defaultValue);
	   else return Character.valueOf(results.charAt(0));//return first character
	   
   }
429672
@Override
    public void characters(char[] ch, int start, int length)
        throws SAXException {
        if (vIsOpen) {
            value.append(ch, start, length);
        }
        if (fIsOpen) {
            formula.append(ch, start, length);
        }
        if (hfIsOpen) {
            headerFooter.append(ch, start, length);
        }
    }
71035
@SuppressWarnings("PMD.UseVarargs")
    public static byte[] toBytes(final char[] chars) {

        // make sure we can handle null inputs
        if (chars == null) {
            return toBytes(new char[0], Charset.defaultCharset().name());
        } else {
            return toBytes(chars, Charset.defaultCharset().name());
        }
    }
485829
public Character getChar(String name) {
        Object o = get(name);
        if (o instanceof Character) {
            return (Character)o;
        }

        if (o != null) {
            String string = o.toString();
            if (string != null && string.length() == 1) {
                return string.charAt(0);
            }
        }
        return null;
    }
41955
@Override
    public CharacterHandler getHandler(char ch) {
        if(wsHandler != null && Character.isWhitespace(ch)) {
            return wsHandler;
        }

        if(ignoreWhitespaces && Character.isWhitespace(ch)) {
            return GlobalCharacterHandlers.NOOP_CHARACTER_HANDLER;
        }

        if(leaveOnWhitespace && Character.isWhitespace(ch)) {
            return GlobalCharacterHandlers.LEAVE_STATE_HANDLER;
        }

        CharacterHandler handler = enterStateHandlers.getHandler(ch);
        if(handler != null) {
            return handler;
        }
        handler = handlers.getHandler(ch);
        if(handler != null) {
            return handler;
        }
        return defaultHandler;
    }
377827
public static char getFirstLetter(char ch) {
		if (ch >= 'a' && ch <= 'z') {
			return ch;
		}
		if (ch >= 'A' && ch <= 'Z') {
			return Character.toLowerCase(ch);
		}
		final byte[] bys = String.valueOf(ch).getBytes(CharsetUtil.CHARSET_GBK);
		if (bys.length == 1) {
			return ch;
		}
		int count = (bys[0] + 256) * 256 + bys[1] + 256;
		if (count < 45217) {
			return ch;
		} else if (count < 45253) {
			return 'a';
		} else if (count < 45761) {
			return 'b';
		} else if (count < 46318) {
			return 'c';
		} else if (count < 46826) {
			return 'd';
		} else if (count < 47010) {
			return 'e';
		} else if (count < 47297) {
			return 'f';
		} else if (count < 47614) {
			return 'g';
		} else if (count < 48119) {
			return 'h';
		} else if (count < 49062) {
			return 'j';
		} else if (count < 49324) {
			return 'k';
		} else if (count < 49896) {
			return 'l';
		} else if (count < 50371) {
			return 'm';
		} else if (count < 50614) {
			return 'n';
		} else if (count < 50622) {
			return 'o';
		} else if (count < 50906) {
			return 'p';
		} else if (count < 51387) {
			return 'q';
		} else if (count < 51446) {
			return 'r';
		} else if (count < 52218) {
			return 's';
		} else if (count < 52698) {
			return 't';
		} else if (count < 52980) {
			return 'w';
		} else if (count < 53689) {
			return 'x';
		} else if (count < 54481) {
			return 'y';
		} else if (count < 55290) {
			return 'z';
		}
		return ch;
	}
1122506
public static Characters allBut(String chars) {
        return StringUtils.isEmpty(chars) ? Characters.ALL : new Characters(true, chars.toCharArray());
    }
755464
function makeMail(char) {
    let mail = function (messageIDorLabels, lastMailId) {
        // Matching to the inbox function when the second argument exists (since
        // 2nd function only takes 1 argument), or if the first argument is an
        // array or undefined.
        if (messageIDorLabels === undefined || Array.isArray(messageIDorLabels)
            || lastMailId !== undefined) {
            return char.agent.request('get_characters_character_id_mail', {
                path: { character_id: char.id },
                query: { labels: messageIDorLabels, last_mail_id: lastMailId }
            }, char.ssoToken);
        }
        else {
            return new MessageImpl(char, messageIDorLabels);
        }
    };
    let allMail = page_loader_1.makeIDBasedLoader(maxID => mail(undefined, maxID), item => item.mail_id, 50);
    mail.all = function () {
        return allMail.getAll();
    };
    mail.labels = makeLabels(char);
    mail.unreadCount = function () {
        return char.agent.request('get_characters_character_id_mail_labels', { path: { character_id: char.id } }, char.ssoToken)
            .then(result => result.total_unread_count || 0);
    };
    mail.cspaCost = function (to) {
        return char.agent.request('post_characters_character_id_cspa', { path: { character_id: char.id }, body: { characters: to } }, char.ssoToken).then(result => result.cost || 0);
    };
    mail.send = function (mail) {
        return char.agent.request('post_characters_character_id_mail', { path: { character_id: char.id }, body: mail }, char.ssoToken);
    };
    mail.lists = function () {
        return char.agent.request('get_characters_character_id_mail_lists', { path: { character_id: char.id } }, char.ssoToken);
    };
    return mail;
}
306721
function (char) {
                var
                    linkState = this._linkState;
                if ("]" === char && 0 === linkState) {
                    ++this._linkState;
                } else if ("(" === char && 1 === linkState) {
                    ++this._linkState;
                } else if (")" === char && 2 === linkState) {
                    return this._finishLink();
                } else if (0 === linkState) {
                    this._linkText.push(char);
                } else if (2 === linkState) {
                    /*
                     * https://github.com/ArnaudBuchholz/gpf-js/issues/33
                     * Filter out tabs and carriage returns
                     */
                    if (-1 === "\t\n".indexOf(char)) {
                        this._linkUrl.push(char);
                    }
                }
                // Else... nothing. do some kind of error handling?
            }
507426
public static CharPredicate among(final String chars) {
    return new CharPredicate() {
      @Override public boolean isChar(char c) {
        return chars.indexOf(c) >= 0;
      }
      @Override public String toString() {
        return '[' + chars + ']';
      }
    };
  }