chars between 0080 and FFEF with exclusions.
It contains various alphabets such as latin extended,
hebrew, arabic, chinese, tamil... and symbols
764402
Rule LatinExtendedAndOtherAlphabet() {
		return FirstOf(
				CharRange('\u0080', '\u074F'), //Latin to Syriac
				CharRange('\u0780', '\u07BF'), //Thaana
				CharRange('\u0900', '\u137F'), //Devanagari to Ethiopic
				CharRange('\u13A0', '\u18AF'), //Cherokee to Mongolian
				CharRange('\u1900', '\u197F'), //Limbu to Tai Le
				CharRange('\u19E0', '\u19FF'), //Khmer
				CharRange('\u1D00', '\u1D7F'), //Phonetic ext 
				CharRange('\u1E00', '\u2BFF'), //Latin ext add to misc symbol & arrows
				CharRange('\u2E80', '\u2FDF'), //CJK radicals to Kangxi radical
				CharRange('\u2FF0', '\u31BF'), //Ideographic desc chars to Bopomofo ext
				CharRange('\u31F0', '\uA4CF'), //Katakana phonet ext to Yi radicals
				CharRange('\uAC00', '\uD7AF'), //Hangul syllable
				//exclude Surrogates
				CharRange('\uF900', '\uFE0F'), //CJK compat to Variation selectors
				CharRange('\uFE20', '\uFFEF') //combin half mark to halfwidth & fullwidth forms
			).suppressNode();
	}
834444
private static boolean matchInf(byte[] str, byte firstchar, int start, int end) {
    final int len = end - start;
    // The wonders of unicode. The infinity symbol \u221E is three bytes:
    if(len == 3 && firstchar == -0x1E && str[start + 1] == -0x78 && str[start + 2] == -0x62) {
      return true;
    }
    if((len != 3 && len != INFINITY_LENGTH) //
        || (firstchar != 'I' && firstchar != 'i')) {
      return false;
    }
    for(int i = 1, j = INFINITY_LENGTH + 1; i < INFINITY_LENGTH; i++, j++) {
      final byte c = str[start + i];
      if(c != INFINITY_PATTERN[i] && c != INFINITY_PATTERN[j]) {
        return false;
      }
      if(i == 2 && len == 3) {
        return true;
      }
    }
    return true;
  }
37913
def com_google_fonts_check_family_control_chars(ttFonts):
  """"""
  # list of unacceptable control character glyph names
  # definition includes the entire control character Unicode block except:
  #    - .null (U+0000)
  #    - CR (U+000D)
  unacceptable_cc_list = [
      "uni0001",
      "uni0002",
      "uni0003",
      "uni0004",
      "uni0005",
      "uni0006",
      "uni0007",
      "uni0008",
      "uni0009",
      "uni000A",
      "uni000B",
      "uni000C",
      "uni000E",
      "uni000F",
      "uni0010",
      "uni0011",
      "uni0012",
      "uni0013",
      "uni0014",
      "uni0015",
      "uni0016",
      "uni0017",
      "uni0018",
      "uni0019",
      "uni001A",
      "uni001B",
      "uni001C",
      "uni001D",
      "uni001E",
      "uni001F"
  ]

  # a dict with key:value of font path that failed check : list of unacceptable glyph names
  failed_font_dict = {}

  for ttFont in ttFonts:
    font_failed = False
    unacceptable_glyphs_in_set = []  # a list of unacceptable glyph names identified
    glyph_name_set = set(ttFont["glyf"].glyphs.keys())
    fontname = ttFont.reader.file.name

    for unacceptable_glyph_name in unacceptable_cc_list:
      if unacceptable_glyph_name in glyph_name_set:
        font_failed = True
        unacceptable_glyphs_in_set.append(unacceptable_glyph_name)

    if font_failed:
        failed_font_dict[fontname] = unacceptable_glyphs_in_set

  if len(failed_font_dict) > 0:
    unacceptable_cc_report_string = "The following unacceptable control characters were identified:\n"
    for fnt in failed_font_dict.keys():
      unacceptable_cc_report_string += " {}: {}\n".format(
          fnt, ", ".join(failed_font_dict[fnt])
      )
    yield FAIL, ("{}".format(unacceptable_cc_report_string))
  else:
    yield PASS, ("Unacceptable control characters were not identified.")
1332557
function isSafeString(str) {
      var escape = ['&amp;', '&lt;', '&gt;', '&quot;', '&#x27;', '&#96;'];
      if (typeof str !== "string" || (escape.some(function(specialChar) {
        return str.indexOf(specialChar) >= 0;
      }))) {
        return true;
      }
    }
881673
public static String utf8ToUnicode(String inStr) {

        char[] myBuffer = inStr.toCharArray();

        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < inStr.length(); i++) {
            Character.UnicodeBlock ub = Character.UnicodeBlock.of(myBuffer[i]);
            if (ub == Character.UnicodeBlock.BASIC_LATIN) {
                sb.append(myBuffer[i]);
            } else if (ub == Character.UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS) {
                int j = (int) myBuffer[i] - 65248;
                sb.append((char) j);
            } else {
                int chr1 = (char) myBuffer[i];
                String hexS = Integer.toHexString(chr1);
                String unicode = "\\u" + hexS;
                sb.append(unicode.toLowerCase());
            }
        }
        return sb.toString();

    }
546394
def characters(self):
        
        chars = 0
        for fragment in self.fragments:
            chars += fragment.characters
        return chars
917957
def exclude_chars(text, exclusion=None):
    
    exclusion = [] if exclusion is None else exclusion
    regexp = r"|".join([select_regexp_char(x) for x in exclusion]) or r''
    return re.sub(regexp, '', text)
1357613
protected function _listeGetLi()
    {
        $im = $this->_defList[count($this->_defList)-1]['img'];
        $st = $this->_defList[count($this->_defList)-1]['style'];
        $nb = $this->_defList[count($this->_defList)-1]['nb'];
        $up = (substr($st, 0, 6) === 'upper-');

        if ($im) {
            return array(false, false, $im);
        }

        switch ($st) {
            case 'none':
                return array('helvetica', true, ' ');

            case 'upper-alpha':
            case 'lower-alpha':
                $str = '';
                while ($nb>26) {
                    $str = chr(96+$nb%26).$str;
                    $nb = floor($nb/26);
                }
                $str = chr(96+$nb).$str;

                return array('helvetica', false, ($up ? strtoupper($str) : $str).'.');

            case 'upper-roman':
            case 'lower-roman':
                $str = $this->_listeArab2Rom($nb);

                return array('helvetica', false, ($up ? strtoupper($str) : $str).'.');

            case 'decimal':
                return array('helvetica', false, $nb.'.');

            case 'square':
                return array('zapfdingbats', true, chr(110));

            case 'circle':
                return array('zapfdingbats', true, chr(109));

            case 'disc':
            default:
                return array('zapfdingbats', true, chr(108));
        }
    }
308873
def strToUtf8(value):
    '''
    
    '''
    kassert.is_of_types(value, str)
    if sys.version_info < (3,):
        return ''.join([unichr(ord(x)) for x in value])
    return value
1051731
function encode2UTF8(charCode){
    if(charCode <= 0x7f){
      return [charCode];
    }else if(charCode <= 0x7ff){
      return [0xc0|(charCode>>6), 0x80|(charCode & 0x3f)];
    }else{
      return [0xe0|(charCode>>12), 0x80|((charCode & 0xfc0)>>6), 0x80|(charCode & 0x3f)];
    }
  }
1160823
def utf8str(code)
      if (code & ~(0x7f)) == 0
        # UCS-4 range 0x00000000 - 0x0000007F
        return(code.chr)
      end

      buf = ""
      if (code & ~(0x7ff)) == 0
        # UCS-4 range 0x00000080 - 0x000007FF
        buf << (0b11000000 | (code >> 6)).chr
        buf << (0b10000000 | (code & 0b00111111)).chr
        return(buf)
      end

      if (code & ~(0x000ffff)) == 0
        # UCS-4 range 0x00000800 - 0x0000FFFF
        buf << (0b11100000 | (code >> 12)).chr
        buf << (0b10000000 | ((code >> 6) & 0b00111111)).chr
        buf << (0b10000000 | (code & 0b0011111)).chr
        return(buf)
      end

      # Not used -- JSON only has UCS-2, but for the sake
      # of completeness
      if (code & ~(0x1FFFFF)) == 0
        # UCS-4 range 0x00010000 - 0x001FFFFF
        buf << (0b11110000 | (code >> 18)).chr
        buf << (0b10000000 | ((code >> 12) & 0b00111111)).chr
        buf << (0b10000000 | ((code >> 6) & 0b00111111)).chr
        buf << (0b10000000 | (code & 0b0011111)).chr
        return(buf)
      end

      if (code & ~(0x03FFFFFF)) == 0
        # UCS-4 range 0x00200000 - 0x03FFFFFF
        buf << (0b11110000 | (code >> 24)).chr
        buf << (0b10000000 | ((code >> 18) & 0b00111111)).chr
        buf << (0b10000000 | ((code >> 12) & 0b00111111)).chr
        buf << (0b10000000 | ((code >> 6) & 0b00111111)).chr
        buf << (0b10000000 | (code & 0b0011111)).chr
        return(buf)
      end

      # UCS-4 range 0x04000000 - 0x7FFFFFFF
      buf << (0b11111000 | (code >> 30)).chr
      buf << (0b10000000 | ((code >> 24) & 0b00111111)).chr
      buf << (0b10000000 | ((code >> 18) & 0b00111111)).chr
      buf << (0b10000000 | ((code >> 12) & 0b00111111)).chr
      buf << (0b10000000 | ((code >> 6) & 0b00111111)).chr
      buf << (0b10000000 | (code & 0b0011111)).chr
      return(buf)
    end
658636
static private boolean isIdentChar(char x) {
    return (x == '$') || ((x >= 'a') && (x <= 'z')) || ((x >= 'A') && (x <= 'Z')) || ((x >= '0') && (x <= '9')) || (x == '_');
  }
539200
function disallowed(code) {
  return (
    (code >= 0x0001 && code <= 0x0008) ||
    code === 0x000b ||
    (code >= 0x000d && code <= 0x001f) ||
    (code >= 0x007f && code <= 0x009f) ||
    (code >= 0xfdd0 && code <= 0xfdef) ||
    (code & 0xffff) === 0xffff ||
    (code & 0xffff) === 0xfffe
  )
}
1141267
def get_ctype_charset (text):
    
    for param in text.lower().split(';'):
        param = param.strip()
        if param.startswith('charset='):
            charset = param[8:].strip()
            try:
                codecs.lookup(charset)
                return charset
            except (LookupError, ValueError):
                pass
    return None
481980
def get_precomposed_chars():
	
	return set([
		letter for letter in chart.consonants
		if unicodedata.normalize('NFD', letter) != letter ])
511005
public static Charset getCharsetByByte(int b) {
		switch (b) {

		case 0x01:
			// U.S. MS-DOS
			return forName("IBM437");
		case 0x02:
			// International MS-DOS
			return forName("IBM850");
		case 0x03:
			// Windows ANSI
			return forName("windows-1252");
		case 0x04:
			// Standard Macintosh
			return forName("MacRoman");
		case 0x57:
			// ESRI shape files use code 0x57 to indicate that
			// data is written in ANSI (whatever that means).
			// http://www.esricanada.com/english/support/faqs/arcview/avfaq21.asp
			return forName("windows-1252");
		case 0x59:
			return forName("windows-1252");
		case 0x64:
			// Eastern European MS-DOS
			return forName("IBM852");
		case 0x65:
			// Russian MS-DOS
			return forName("IBM866");
		case 0x66:
			// Nordic MS-DOS
			return forName("IBM865");
		case 0x67:
			// Icelandic MS-DOS
			return forName("IBM861");
			// case 0x68:
			// Kamenicky (Czech) MS-DOS
			// return Charset.forName("895");
			// case 0x69:
			// Mazovia (Polish) MS-DOS
			// return Charset.forName("620");

		case 0x6A:
			// Greek MS-DOS (437G)
			return forName("x-IBM737");
		case 0x6B:
			// Turkish MS-DOS
			return forName("IBM857");
		case 0x78:
			// Chinese (Hong Kong SAR, Taiwan) Windows
			return forName("windows-950");
		case 0x79:
			// Korean Windows
			return Charset.forName("windows-949");
		case 0x7A:
			// Chinese (PRC, Singapore) Windows
			return forName("GBK");
		case 0x7B:
			// Japanese Windows
			return forName("windows-932");
		case 0x7C:
			// Thai Windows
			return forName("windows-874");
		case 0x7D:
			// Hebrew Windows
			return forName("windows-1255");
		case 0x7E:
			// Arabic Windows
			return forName("windows-1256");
		case 0x96:
			// Russian Macintosh
			return forName("x-MacCyrillic");
		case 0x97:
			// Macintosh EE
			return forName("x-MacCentralEurope");
		case 0x98:
			// Greek Macintosh
			return forName("x-MacGreek");
		case 0xC8:
			// Eastern European Windows
			return forName("windows-1250");
		case 0xC9:
			// Russian Windows
			return forName("windows-1251");
		case 0xCA:
			// Turkish Windows
			return forName("windows-1254");
		case 0xCB:
			// Greek Windows
			return forName("windows-1253");
		}
		return null;
	}
917012
def charseq():
    ''''''
    def string_part():
        '''Parse normal string.'''
        return regex(r'[^"\\]+')

    def string_esc():
        '''Parse escaped string.'''
        return string('\\') >> (
            string('\\')
            | string('/')
            | string('"')
            | string('b').result('\b')
            | string('f').result('\f')
            | string('n').result('\n')
            | string('r').result('\r')
            | string('t').result('\t')
            | regex(r'u[0-9a-fA-F]{4}').parsecmap(lambda s: chr(int(s[1:], 16)))
        )
    return string_part() | string_esc()