Beispiel #1
0
def test_decode_cp1251():
    assert Chepy("cff0e8e2e5f2").hex_to_str().decode_cp1251().o == "Привет"
Beispiel #2
0
def test_remove_diacritics():
    assert Chepy("François Chào").remove_diacritics().o.decode() == "Francois Chao"
Beispiel #3
0
def test_encode_cp037():
    assert Chepy("hello").encode_cp037().to_hex().o.decode() == "8885939396"
Beispiel #4
0
def test_decode_iso8859_13():
    assert (
        Chepy("6761725c7865376f6e").hex_to_str().decode_iso8859_13().o == "gar\\xe7on"
    )
Beispiel #5
0
def test_unicode_crs_by_lang():
    assert len(Chepy("I am 합시다").unicode_chrs_by_lang("Hangul").o) == 3
Beispiel #6
0
def test_encode_utf_16_be():
    assert Chepy("안녕").encode_utf_16_be().to_hex().o.decode() == "c548b155"
Beispiel #7
0
def test_encode_utf_7():
    assert Chepy("안녕").encode_utf_7().o.decode() == "+xUixVQ-"
Beispiel #8
0
def test_decode_cp1254():
    assert Chepy("d66ce7656b").hex_to_str().decode_cp1254().o == "Ölçek"
Beispiel #9
0
def test_encode_cp1255():
    assert Chepy("מבחן").encode_cp1255().to_hex().o.decode() == "eee1e7ef"
Beispiel #10
0
def test_decode_cp1253():
    assert Chepy("e4efeae9ecde").hex_to_str().decode_cp1253().o == "δοκιμή"
Beispiel #11
0
def test_encode_cp1254():
    assert Chepy("Ölçek").encode_cp1254().to_hex().o.decode() == "d66ce7656b"
Beispiel #12
0
def test_encode_cp1253():
    assert Chepy("δοκιμή").encode_cp1253().to_hex().o.decode() == "e4efeae9ecde"
Beispiel #13
0
def test_decode_cp1252():
    assert Chepy("676172e76f6e").hex_to_str().decode_cp1252().o == "garçon"
Beispiel #14
0
def test_encode_cp1252():
    assert Chepy("garçon").encode_cp1252().to_hex().o.decode() == "676172e76f6e"
Beispiel #15
0
def test_encode_iso8859_2():
    assert Chepy("Plzeň").encode_iso8859_2().to_hex().o.decode() == "506c7a65f2"
Beispiel #16
0
def test_decode_cp1255():
    assert Chepy("eee1e7ef").hex_to_str().decode_cp1255().o == "מבחן"
Beispiel #17
0
def test_decode_iso8859_2():
    assert Chepy("506c7a65f2").hex_to_str().decode_iso8859_2().o == "Plzeň"
Beispiel #18
0
def test_encode_cp1256():
    assert Chepy("اختبار").encode_cp1256().to_hex().o.decode() == "c7cecac8c7d1"
Beispiel #19
0
def test_decode_utf_16_be():
    assert Chepy("c548b155").hex_to_str().decode_utf_16_be().o == "안녕"
Beispiel #20
0
def test_decode_utf_16_le():
    assert Chepy("48c555b1").hex_to_str().decode_utf_16_le().o == "안녕"
Beispiel #21
0
def test_encode_iso8859_13():
    assert (
        Chepy("garçon").encode_iso8859_13().to_hex().o.decode() == "6761725c7865376f6e"
    )
Beispiel #22
0
def test_decode_cp1256():
    assert Chepy("c7cecac8c7d1").hex_to_str().decode_cp1256().o == "اختبار"
Beispiel #23
0
def test_encode_iso8859_15():
    assert Chepy("garçon").encode_iso8859_15().to_hex().o.decode() == "676172e76f6e"
Beispiel #24
0
def test_encode_cp1257():
    assert Chepy("pārbaude").encode_cp1257().to_hex().o.decode() == "70e2726261756465"
Beispiel #25
0
def test_decode_iso8859_15():
    assert Chepy("676172e76f6e").hex_to_str().decode_iso8859_15().o == "garçon"
Beispiel #26
0
def test_decode_cp1257():
    assert Chepy("70e2726261756465").hex_to_str().decode_cp1257().o == "pārbaude"
Beispiel #27
0
def test_decode_utf_7():
    assert Chepy("+xUixVQ-").decode_utf_7().o == "안녕"
Beispiel #28
0
def test_encode_cp1258():
    assert (
        Chepy("tạm biệt").encode_cp1258().to_hex().o.decode()
        == "745c75316561316d2062695c753165633774"
    )
Beispiel #29
0
def test_decode_cp037():
    assert Chepy("8885939396").hex_to_str().decode_cp037().o == "hello"
Beispiel #30
0
def test_encode_utf_16_le():
    assert Chepy("안녕").encode_utf_16_le().to_hex().o.decode() == "48c555b1"