예제 #1
0
def _check_charset(charset):
    log = u"あいうえお नेपाल"
    chunk = (log + '\n').encode(charset)
    lp = GetParser('LineParser', charset=charset)
    lp.write(chunk)

    eq_({'msg': log.encode('utf-8'), '_type_str': 'msg'}, lp.next(), charset)
예제 #2
0
def test_unspecified_charset():
    log = u"あいうえお नेपाल"
    chunk = (log + '\n').encode('utf-8')
    lp = GetParser('LineParser')
    lp.write(chunk)

    eq_({'msg': log.encode('utf-8'), '_type_str': 'msg'}, lp.next())