コード例 #1
0
ファイル: __init__.py プロジェクト: galaxyguardians/galaxy
def is_multi_byte( chars ):
    for char in chars:
        try:
            char = unicode( char )
        except UnicodeDecodeError:
            # Probably binary
            return False
        if ( wchartype.is_asian( char ) or wchartype.is_full_width( char ) or
                wchartype.is_kanji( char ) or wchartype.is_hiragana( char ) or
                wchartype.is_katakana( char ) or wchartype.is_half_katakana( char ) or
                wchartype.is_hangul( char ) or wchartype.is_full_digit( char ) or
                wchartype.is_full_letter( char )):
            return True
    return False
コード例 #2
0
def is_multi_byte( chars ):
    for char in chars:
        try:
            char = unicode( char )
        except UnicodeDecodeError:
            # Probably binary
            return False
        if ( wchartype.is_asian( char ) or wchartype.is_full_width( char ) or
             wchartype.is_kanji( char ) or wchartype.is_hiragana( char ) or
             wchartype.is_katakana( char ) or wchartype.is_half_katakana( char )
             or wchartype.is_hangul( char ) or wchartype.is_full_digit( char )
             or wchartype.is_full_letter( char )):
            return True
    return False
コード例 #3
0
ファイル: multi_byte.py プロジェクト: bwlang/galaxy
def is_multi_byte(chars):
    if wchartype is None:
        message = "Attempted to use galaxy.util.multi_byte but dependency wchartype is unavailable."
        raise Exception(message)
    for char in chars:
        try:
            char = text_type(char)
        except UnicodeDecodeError:
            # Probably binary
            return False
        if (wchartype.is_asian(char) or wchartype.is_full_width(char) or
                wchartype.is_kanji(char) or wchartype.is_hiragana(char) or
                wchartype.is_katakana(char) or wchartype.is_half_katakana(char) or
                wchartype.is_hangul(char) or wchartype.is_full_digit(char) or
                wchartype.is_full_letter(char)):
            return True
    return False
コード例 #4
0
ファイル: multi_byte.py プロジェクト: Galaxyinternship/Galaxy
def is_multi_byte( chars ):
    if wchartype is None:
        message = "Attempted to use galaxy.util.multi_byte but dependency wchartype is unavailable."
        raise Exception(message)
    for char in chars:
        try:
            char = text_type( char )
        except UnicodeDecodeError:
            # Probably binary
            return False
        if ( wchartype.is_asian( char ) or wchartype.is_full_width( char ) or
                wchartype.is_kanji( char ) or wchartype.is_hiragana( char ) or
                wchartype.is_katakana( char ) or wchartype.is_half_katakana( char ) or
                wchartype.is_hangul( char ) or wchartype.is_full_digit( char ) or
                wchartype.is_full_letter( char )):
            return True
    return False