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)
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())