Вот мой скрипт:
# coding: utf8
from bottle import get, run, template
import sqlite3
import sys
@get('/')
def todo_list():
conn = sqlite3.connect('dedikz.db')
c = conn.cursor()
for x in c.execute("SELECT port, ip, user, password FROM dediks WHERE active LIKE '1'"):
yield 'port ' + str(x[0]) + '<br>'.setdefaultencoding('utf-8')
yield 'ip ' + str(x[1]) + '<br>'.setdefaultencoding('utf-8')
yield 'user ' + str(x[2]) + '<br>'.setdefaultencoding('utf-8')
yield 'password ' + str(x[3]) + '<br>'.setdefaultencoding('utf-8')
yield '<br>'
run(host='localhost', port=8084, debug=True)
Почему он пишет ошибку:
UnicodeEncodeError('ascii', u'3389 \u043f\u0438\u0441\u044e\u043d', 5, 10, 'ordinal not in range(128)')