Example #1
0
def test_strcoll_u():
    orig_locale = rsetlocale(LC_COLLATE, None)
    rsetlocale(LC_COLLATE, "fr_FR.ISO8859-1")
    e_acute = u'é'.encode('latin1')
    assert strcoll_u('f', 'e') > 0
    assert strcoll_u('f', e_acute) > 0
    rsetlocale(LC_COLLATE, orig_locale)
Example #2
0
def test_strcoll_u():
    orig_locale = rsetlocale(LC_COLLATE, None)
    rsetlocale(LC_COLLATE, "fr_FR.ISO8859-1")
    e_acute = u'é'.encode('latin1')
    assert strcoll_u('f', 'e') > 0
    assert strcoll_u('f', e_acute) > 0
    rsetlocale(LC_COLLATE, orig_locale)
Example #3
0
def has_locales(*locales):
    """Check if te locales are available on the system"""
    orig_locale = rsetlocale(LC_CTYPE, None)
    try:
        for locale in locales:
            rsetlocale(LC_CTYPE, locale)
    except LocaleError:
        return False
    else:
        return True
    finally:
        rsetlocale(LC_CTYPE, orig_locale)
Example #4
0
def has_locales(*locales):
    """Check if te locales are available on the system"""
    orig_locale = rsetlocale(LC_CTYPE, None)
    try:
        for locale in locales:
            rsetlocale(LC_CTYPE, locale)
    except LocaleError:
        return False
    else:
        return True
    finally:
        rsetlocale(LC_CTYPE, orig_locale)