Beispiel #1
0
def test_oounicode():
    u = ootype.oounicode(u'a', -1)
    assert isinstance(u, ootype._string)
    assert ootype.typeOf(u) is ootype.Unicode

    s = ootype.make_string('a string')
    u = ootype.oounicode(s, -1)
    assert isinstance(u, ootype._string)
    assert ootype.typeOf(u) is ootype.Unicode

    s = ootype.make_string('non-ascii string: \xe0')
    py.test.raises(UnicodeDecodeError, ootype.oounicode, s, -1)
Beispiel #2
0
Datei: rstr.py Projekt: sota/pypy
 def ll_unichr2unicode(ch):
     return ootype.oounicode(ch, -1)
Beispiel #3
0
Datei: rstr.py Projekt: sota/pypy
 def ll_str2unicode(s):
     return ootype.oounicode(s, -1)
Beispiel #4
0
 def ll_unichr2unicode(ch):
     return ootype.oounicode(ch, -1)
Beispiel #5
0
 def ll_str2unicode(s):
     return ootype.oounicode(s, -1)