Returns if chr is an reserved character according 1.5 of rfc 6570
or the percent character mentioned in 3.2.1.
@param chr
@return {Boolean}
188937
function isReserved (chr) {
        return chr === ':' || chr === '/' || chr === '?' || chr === '#' || chr === '[' || chr === ']' || chr === '@' || chr === '!' || chr === '$' || chr === '&' || chr === '(' ||
            chr === ')' || chr === '*' || chr === '+' || chr === ',' || chr === ';' || chr === '=' || chr === "'";
    }
349429
public static boolean isValidXmlChar(int ch)
    {
        return (ch == 0x9)
            || (ch == 0xA)
            || (ch == 0xD)
            || (ch >= 0x20 && ch <= 0xD7FF)
            || (ch >= 0xE000 && ch <= 0xFFFD)
            || (ch >= 0x10000 && ch <= 0x10FFFF);
    }
393443
public static boolean endsWithChar(String str, char ch) {
        if (StringUtils.isEmpty(str)) {
            return false;
        }

        return str.charAt(str.length() - 1) == ch;
    }
562748
function isValidPathCharacter(ch) {
  if (!ch) {
    return false
  }

  const sub = ['!', '$', '&', "'", '(', ')', '*', '+', ',', ';', '='].map(code)
  return concat(ALPHA, DIGIT, sub, code(':'), code('@')).indexOf(code(ch)) > -1
}
809153
public static boolean checkCharacter(int c, boolean foundQuestionMark) throws IOException {
		if(foundQuestionMark) {
			switch(c) {
				case '.':
				case '-':
				case '*':
				case '_':
				case '+': // converted space
				case '%': // encoded value
				// Other characters used outside the URL data
				//case ':':
				//case '/':
				//case '@':
				//case ';':
				//case '?':
				// Parameter separators
				case '=':
				case '&':
				// Anchor separator
				case '#':
					return true;
				default:
					if(
						(c<'a' || c>'z')
						&& (c<'A' || c>'Z')
						&& (c<'0' || c>'9')
					) throw new IOException(ApplicationResources.accessor.getMessage("UrlValidator.invalidCharacter", Integer.toHexString(c)));
					return true;
			}
		} else {
			return c=='?';
		}
	}
1321750
function fixedCharCodeAt(str, idx) {
  idx = idx || 0;
  var code = str.charCodeAt(idx), hi, low;
  if (0xD800 <= code && code <= 0xDBFF) {
    // High surrogate (could change last
    // hex to 0xDB7F to treat high private
    // surrogates as single characters)
    hi = code;
    low = str.charCodeAt(idx + 1);
    return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;
  }
  if (0xDC00 <= code && code <= 0xDFFF) {
    // Low surrogate
    // We return false to allow loops to skip this iteration since should have
    // already handled high surrogate above in the previous iteration
    return false;
    /*hi = str.charCodeAt(idx-1);
     low = code;
     return ((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000;*/
  }
  return code;
}
1324526
function(str){
            str = (str || "").toString();
            str = str.replace(/\=(?:\r?\n|$)/g, "");
            var str2 = "";
            for(var i=0, len = str.length; i<len; i++){
                chr = str.charAt(i);
                if(chr == "=" && (hex = str.substr(i+1, 2)) && /[\da-fA-F]{2}/.test(hex)){
                    str2 += String.fromCharCode(parseInt(hex,16));
                    i+=2;
                    continue;
                }
                str2 += chr;
            }
            return str2;
        }
214162
private static boolean hasUnsafeChars(String s) {
        for (int i = 0; i < s.length(); ++i) {
            char c = s.charAt(i);
            if (Character.isLetter(c) || c == '.')
                continue;
            else
                return true;
        }
        return false;
    }
917971
function(charCode) {
                var isSpecialCharacterEmoji = charCode === 0x3030 || charCode === 0x00AE || charCode === 0x00A9,
                    inEmoticonBlock = 0x1F600 <= charCode && charCode <= 0x1F64F,
                    miscSymbolsAndPictogram = 0x1F300 <= charCode && charCode <= 0x1F5FF,
                    transportAndMap = 0x1F680 <= charCode && charCode <= 0x1F6FF,
                    miscSymbol = 0x2600 <= charCode && charCode <= 0x26FF,
                    dingbat = 0x2700 <= charCode && charCode <= 0x27BF,
                    variation = 0xFE00 <= charCode && charCode <= 0xFE0F,
                    arrow = 0x20D0 <= charCode && charCode <= 0x20FF;

                return isSpecialCharacterEmoji || miscSymbolsAndPictogram || transportAndMap || inEmoticonBlock || miscSymbol || dingbat || variation || arrow;
            }
822212
public boolean isCellDelimiter(char ch) {
      return ch == repetitionDelimiter || ch == fieldDelimiter || ch == subComponentDelimiter  || ch ==  componentDelimiter;
    }
634392
public static function ord($chr)
    {
        if (static::strlen($chr) > 1) {
            $chr = static::substr($chr, 0, 1);
        }

        // we do want to use strlen here !
        switch (strlen($chr)) {
            case 1:
                return ord($chr);
            case 2:
                return ((ord($chr[0]) & 0x1F) << 6) | (ord($chr[1]) & 0x3F);
            case 3:
                return ((ord($chr[0]) & 0x0F) << 12) | ((ord($chr[1]) & 0x3F) << 6) | (ord($chr[2]) & 0x3F);
            case 4:
                return ((ord($chr[0]) & 0x07) << 18) | ((ord($chr[1]) & 0x3F) << 12) | ((ord($chr[2]) & 0x3F) << 6) | (ord($chr[3]) & 0x3F);
            case 0:
                return 0;
            default:
                // should just never happen
                return null;
        }
    }
923843
public static boolean isSpaceChar(char c) {
		if (c == 0x20) return true;
		if (c > 0xD) return false;
		if (c < 0x9) return false;
		return isSpace[c - 9];
	}
79393
public static void checkCharacter(char c) throws IOException {
		if(
			(c < 0x20 || c > 0xD7FF) // common case first
			&& c != 0x9
			&& c != 0xA
			&& c != 0xD
			&& (c < 0xE000 || c > 0xFFFD)
			// high and low surrogates
			//&& (c < 0x10000 || c > 0x10FFFF)
			&& (c < Character.MIN_HIGH_SURROGATE || c > Character.MAX_LOW_SURROGATE)

		) throw new IOException(ApplicationResources.accessor.getMessage("XhtmlValidator.invalidCharacter", Integer.toHexString(c)));
	}
690248
public static boolean hasSingleCharacterArg(Closure c) {
        if (c.getMaximumNumberOfParameters() != 1) return false;
        String typeName = c.getParameterTypes()[0].getName();
        return typeName.equals("char") || typeName.equals("java.lang.Character");
    }
1054321
protected function getCharCode(string $chr):int{
		$i = \array_search($chr, $this::ALPHANUM_CHAR_MAP);

		if($i !== false){
			return $i;
		}

		throw new QRCodeDataException('illegal char: "'.$chr.'" ['.\ord($chr).']');
	}
729851
public static boolean isSafeChar(char ch) {
        if (ch >= 'a' && ch <= 'z')
            return true;
        if (ch >= 'A' && ch <= 'Z')
          return true;
        if (ch >= '0' && ch <= '9')
          return true;
        // loop thru our PRINTABLE string
        for (int i = 0; i < SAFE.length(); i++) {
            if (ch == SAFE.charAt(i))
                return true;
        }
        return false;
    }
1155917
private Boolean isGoodCharacters(String data) { //PI57228
        // if the last character is a CR or LF, then this fails
        int index = data.length() - 1;
        if (index < 0) {
            // empty string, quit now with success
            return true;
        }
        String error = null;
        char c = data.charAt(index);
        if (BNFHeaders.LF == c || BNFHeaders.CR == c) {
            error = "Illegal trailing EOL";
        }

        // scan through the data now for invalid CRLF presence. Note that CRLFs
        // may be followed by whitespace for valid multiline headers.
        for (int i = 0; null == error && i <= index; i++) {
            c = data.charAt(i);
            if (i < index) {
                if (BNFHeaders.CR == c) {
                    // next char must be an LF
                    if (BNFHeaders.LF != data.charAt(i + 1)) {
                        error = "Invalid CR not followed by LF";
                    }
                } else if (BNFHeaders.LF == c) {
                    char x = data.charAt(i + 1);

                    // if it is not followed by whitespace then this value is bad
                    if (BNFHeaders.TAB != x && BNFHeaders.SPACE != x) {
                        error = "Invalid LF not followed by whitespace";
                    } else {
                        return false;
                    }
                }
            }
            if (c >= 32 && c < 127) {
                //Do nothing as this is a good Character
            } else if (c == BNFHeaders.LF || c == BNFHeaders.CR) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "Found a CR or LF");
                }
                return false;
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(tc, "The Character: " + c + " is not printable");
                }
                final int maskedCodePoint = c & 0xFF;
                if (maskedCodePoint == BNFHeaders.LF || maskedCodePoint == BNFHeaders.CR) {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                        Tr.debug(tc, "Character: " + c + " unicode ends with a 0a or 0d");
                        Tr.debug(tc, "The Unicode is: " + (char) maskedCodePoint);
                    }
                    return false;
                }
                return false;
            }
        }

        // if we found an error, throw the exception now
        if (null != error) {
            IllegalArgumentException iae = new IllegalArgumentException(error);
            FFDCFilter.processException(iae, getClass().getName() + ".isGoodCharacters(String)", "1", this);
            throw iae;
        }
        return true; //If we get here without returning it means all characters are good.
    }