Exemple #1
0
    def test_big5_to_utf8(self):
        result = util.big5_to_utf8('test')
        logging.debug('result: (%s, %s)', result, result.__class__.__name__)
        assert result == 'test'

        result_big5 = util.utf8_to_big5(u'我')
        logging.debug('result_big5: (%s, %s)', result_big5, result_big5.__class__.__name__)
        result = util.big5_to_utf8(result_big5)
        logging.debug('result: (%s, %s)', result, result.__class__.__name__)
        assert result == u'我'
def _parse_dig(http_data):
    #cfg.logger.debug('http_data_type: %s', http_data.__class__.__name__)
    http_data_ascii = http_data.encode('iso-8859-1')
    data_utf8 = util.big5_to_utf8(http_data_ascii)
    #cfg.logger.debug('data_utf8: %s', data_utf8)

    (latest_timestamp, data_list) = _parse_dig_data(data_utf8)
    return (latest_timestamp, data_list)
Exemple #3
0
def _parse_dig(http_data):
    http_data_ascii = http_data.encode('iso-8859-1')
    data_utf8 = util.big5_to_utf8(http_data_ascii)

    #cfg.logger.debug('data_utf8: %s', data_utf8)

    data_list = _parse_dig_data(data_utf8)
    return data_list
Exemple #4
0
def _parse_dig(http_data):
    #cfg.logger.debug('http_data_type: %s', http_data.__class__.__name__)
    http_data_ascii = http_data.encode('iso-8859-1')
    data_utf8 = util.big5_to_utf8(http_data_ascii)
    #cfg.logger.debug('data_utf8: %s', data_utf8)

    (latest_timestamp, data_list) = _parse_dig_data(data_utf8)
    return (latest_timestamp, data_list)
def _parse_dig(http_data):
    http_data_ascii = http_data.encode('iso-8859-1')
    data_utf8 = util.big5_to_utf8(http_data_ascii)

    #cfg.logger.debug('data_utf8: %s', data_utf8)

    data_list = _parse_dig_data(data_utf8)
    return data_list