diff --git a/historymodel.cpp b/historymodel.cpp index 38231e9..aaf4211 100644 --- a/historymodel.cpp +++ b/historymodel.cpp @@ -99,16 +99,18 @@ QVariant HistoryModel::data(const QModelIndex &index, int role) const } case 8:{ std::string tmp = item.request_content; - replaceAll(tmp, "\\n", "\n"); - return QString::fromStdString(tmp); + //replaceAll(tmp, "\\n", "\n"); + return QString::fromUtf8(tmp.c_str()); } case 9:{ return QString::fromStdString(getResponseHeader(item)); } case 10:{ std::string tmp = item.response_content; - replaceAll(tmp, "\\n", "\n"); - return QString::fromStdString(tmp); + //replaceAll(tmp, "\\", "\"); + //std::cout << tmp << std::endl; + return QString::fromUtf8(tmp.c_str()); + //return QString::fromStdString(tmp); } } throw std::out_of_range("history model col"); diff --git a/mitmaddon/littlesnitch.py b/mitmaddon/littlesnitch.py index 8ff7bfb..92c6fa7 100644 --- a/mitmaddon/littlesnitch.py +++ b/mitmaddon/littlesnitch.py @@ -15,7 +15,13 @@ def convert_to_strings(obj): elif isinstance(obj, list) or isinstance(obj, tuple): return [convert_to_strings(element) for element in obj] elif isinstance(obj, bytes): - return str(obj)[2:-1] + data = "" + try: + data = obj.decode('unicode-escape').encode('latin1').decode('utf-8') + except: + data = str(obj)[2:-1] + return data + return obj class NetworkThread(threading.Thread):