Пример #1
0
    def __init__(self, bgb=None, encoding=None):
        self._buf = bgb if bgb is not None else bytegapbuffer()
        self._encoding = encoding if encoding is not None else 'utf-8'

        self._index = []
        self._length = 0
        self._form_initial_index()
Пример #2
0
def demo_string():
    buf = DEMO_BUF
    return codecs.decode(buf, 'utf-8'), codedstring(bytegapbuffer(buf))
Пример #3
0
def torture_string():
    buf = TORTURE_BUF
    return (
        codecs.decode(buf, 'utf-8', 'replace'), codedstring(bytegapbuffer(buf))
    )
Пример #4
0
def ascii_string():
    s = 'hello, world'
    return s, codedstring(bytegapbuffer(s.encode('utf-8')))