随机ASCII字符(含字母，数字及其他符号)，固定长度
17451
public static String randomAsciiFixLength(Random random, int length) {
		return RandomStringUtils.random(length, 32, 127, false, false, null, random);
	}
1330727
function(charCode)
	{
		var output = "";
		if (charCode>255) {
			output = "\\u"+(charCode<4096?"0":"")+charCode.toString(16);
		} else if (charCode>127) {
			output = "\\x"+charCode.toString(16);
		} else {
			output = (this.needsEscapingInCharClass(charCode)?"\\":"")+String.fromCharCode(charCode);
		}
		return output;
	}
328891
def _safe_unicode(o):
    
    def clean(s):
        return u''.join([c if c in ASCII_PRINTABLE else '?' for c in s])
    if USING_PYTHON2:
        try:
            return unicode(o)
        except:
            try:
                s = str(o)
                try:
                    return s.decode("utf-8")
                except:
                    return clean(s[:2048]) + u" [Raw error message: " + unicode(s.encode("hex"), 'utf-8') + u"]"
            except:
                return u"(Unable to decode Python exception message)"
    else:
        return str(o)
1132168
def ASCII_encoding(self):
        """"""

        w = unicodedata.normalize('NFKD', self.word).encode('ASCII',
                                                            'ignore')  # Encode into ASCII, returns a bytestring
        w = w.decode('utf-8')  # Convert back to string

        return w
763325
private function encodeChar(&$data, $encoding, $seq, $text, &$i, &$counter, &$indcheck) {
        if (isset($seq[$i + 1]) && $seq[$i + 1] === 'F') {
            // We have a flag !!
            if ($text[$counter + 1] === 'F') {
                $number = $text[$counter + 2];
                $fnc = $this->fnc[$encoding][$number - 1];
                $indcheck[] = $fnc;
                $data[] = $this->code[$fnc];

                // Skip F + number
                $counter += 2;
            } else {
                // Not supposed
            }

            $i++;
        } else {
            if ($encoding === 2) {
                // We take 2 numbers in the same time
                $code = (int)substr($text, $counter, 2);
                $indcheck[] = $code;
                $data[] = $this->code[$code];
                $counter++;
                $i++;
            } else {
                $keys = ($encoding === 0) ? $this->keysA : $this->keysB;
                $pos = strpos($keys, $text[$counter]);
                $indcheck[] = $pos;
                $data[] = $this->code[$pos];
            }
        }

        $counter++;
    }
1277409
def ascii(graph):
    """"""
    from .._ascii import DAG
    from .._echo import echo_via_pager

    echo_via_pager(str(DAG(graph)))
381437
function( input ) {

		if ( input == null ) {

			input = this.result;

		}

			this.result = input.replace(/(\s[\u0645]+[\u06CC])+\s/g, "$1\u200C");

			this.result = this.result.replace(/([\u0647])+\s+([\u0627]+[\u0645]||[\u0627]+[\u0649]||[\u0627]+[\u0649]+[\u0649]||[\u0627]+[\u0649]+[\u0645]||[\u0649]+[\u0646]+[\u062f]||[\u0627]+[\u0649]+[\u062f])/g, "$1\u200C$2");

			return this;

	}
44099
def convertascii(value, command='to'):
    
    command = command.lower()
    if command == 'to':
        return chr(value)
    elif command == 'from':
        return ord(value)
    else:
        raise ValueError('Invalid operation provided.')
952846
def char(i):
    

    i = ord(i)
    if i not in font:
        return [(0,)] * 8
    return [(ord(row),) for row in font[i].decode('hex')]
113737
public function toAscii()
    {
        if ($this->isIdn() && $this->isUnicode())
            $this->host = (new IdnaConvert())->encode($this->host);
    }
1213666
def ascii_mode(enabled=True):
    
    global _backups, _chars, _primary_style, _secondary_style, _ascii_mode
    if not (enabled or _backups) or (enabled and _ascii_mode):
        return
    if enabled:
        _backups = _chars.copy(), _primary_style, _secondary_style
        _chars = {
            "primary": {"selected": "*", "block": "#"},
            "secondary": {"arrow": ">", "left-edge": "|", "right-edge": "|"},
            "plain": {"unselected": "."},
        }
        _primary_style = ()
        _secondary_style = ()
    else:
        _chars, _primary_style, _secondary_style = _backups
    _ascii_mode = enabled
1360346
def letter_set(self):
        
        end_str = ctypes.create_string_buffer(MAX_CHARS)

        cgaddag.gdg_letter_set(self.gdg, self.node, end_str)

        return [char for char in end_str.value.decode("ascii")]
1023905
private static int getChsAscii(String chs) {
		int asc = 0;
		byte[] bytes = chs.getBytes(CharsetUtil.CHARSET_GBK);
		switch (bytes.length) {
		case 1:
			// 英文字符
			asc = bytes[0];
			break;
		case 2:
			// 中文字符
			int hightByte = 256 + bytes[0];
			int lowByte = 256 + bytes[1];
			asc = (256 * hightByte + lowByte) - 256 * 256;
			break;
		default:
			throw new UtilException("Illegal resource string");
		}
		return asc;
	}
790618
private Integer[] unicodeToWinAnsi(int unicode) {
        List ret = new java.util.ArrayList();
        for (int i = 32; i < Glyphs.WINANSI_ENCODING.length; i++) {
            if (unicode == Glyphs.WINANSI_ENCODING[i]) {
                ret.add(new Integer(i));
            }
        }
        return (Integer[])ret.toArray(new Integer[0]);
    }
1366365
function (str) {
	   return str.replace(/[àáâãäå]/g,"a").
					  replace(/[èéêë]/g,"e").
					  replace(/[ìíîï]/g,"i").
					  replace(/[òóôõö]/g,"o").
					  replace(/[ùúûü]/g,"u").
					  replace(/[ýÿ]/g,"y").
					  replace(/[ñ]/g,"n").
					  replace(/[ç]/g,"c").
					  replace(/[œ]/g,"oe").
					  replace(/[æ]/g,"ae");
	}
530510
private static boolean nonASCII(String s) {
    for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) > 0x7F) {
          return true;
      }
    }
    return false;
  }
341737
function(string) {
            
            var i = 0;
            while(i < string.length)
            {
                if(     (// ASCII
                string[i] == 0x09 ||
                    string[i] == 0x0A ||
                    string[i] == 0x0D ||
                    (0x20 <= string[i] && string[i] <= 0x7E)
                    )
                    ) {
                    i += 1;
                    continue;
                }
                
                if(     (// non-overlong 2-byte
                (0xC2 <= string[i] && string[i] <= 0xDF) &&
                    (0x80 <= string[i+1] && string[i+1] <= 0xBF)
                    )
                    ) {
                    i += 2;
                    continue;
                }
                
                if(     (// excluding overlongs
                string[i] == 0xE0 &&
                    (0xA0 <= string[i + 1] && string[i + 1] <= 0xBF) &&
                    (0x80 <= string[i + 2] && string[i + 2] <= 0xBF)
                    ) ||
                    (// straight 3-byte
                ((0xE1 <= string[i] && string[i] <= 0xEC) ||
                    string[i] == 0xEE ||
                    string[i] == 0xEF) &&
                    (0x80 <= string[i + 1] && string[i+1] <= 0xBF) &&
                    (0x80 <= string[i+2] && string[i+2] <= 0xBF)
                    ) ||
                    (// excluding surrogates
                string[i] == 0xED &&
                    (0x80 <= string[i+1] && string[i+1] <= 0x9F) &&
                    (0x80 <= string[i+2] && string[i+2] <= 0xBF)
                    )
                    ) {
                    i += 3;
                    continue;
                }
                
                if(     (// planes 1-3
                string[i] == 0xF0 &&
                    (0x90 <= string[i + 1] && string[i + 1] <= 0xBF) &&
                    (0x80 <= string[i + 2] && string[i + 2] <= 0xBF) &&
                    (0x80 <= string[i + 3] && string[i + 3] <= 0xBF)
                    ) ||
                    (// planes 4-15
                (0xF1 <= string[i] && string[i] <= 0xF3) &&
                    (0x80 <= string[i + 1] && string[i + 1] <= 0xBF) &&
                    (0x80 <= string[i + 2] && string[i + 2] <= 0xBF) &&
                    (0x80 <= string[i + 3] && string[i + 3] <= 0xBF)
                    ) ||
                    (// plane 16
                string[i] == 0xF4 &&
                    (0x80 <= string[i + 1] && string[i + 1] <= 0x8F) &&
                    (0x80 <= string[i + 2] && string[i + 2] <= 0xBF) &&
                    (0x80 <= string[i + 3] && string[i + 3] <= 0xBF)
                    )
                    ) {
                    i += 4;
                    continue;
                }
                
                return false;
            }
            
            return true;
        }