diff --git a/Linux/Tentia.py b/Linux/Tentia.py index 1024e63..ad75bdf 100755 --- a/Linux/Tentia.py +++ b/Linux/Tentia.py @@ -1,4 +1,5 @@ #!/usr/bin/env python + import os, sys, pickle, subprocess from PyQt4 import QtCore, QtGui, QtWebKit import Windows, Helper @@ -137,9 +138,10 @@ class Controller(QtCore.QObject): self.app.new_message_windows.append(new_message_window) def sendMessage(self, message): - text = str.replace(str(message.text), "\\", "\\\\") - text = str.replace(text, "\"", "\\\"") - text = str.replace(text, "\n", "\\n") + text = message.text + text = unicode.replace(text, "\\", "\\\\") + text = unicode.replace(text, "\"", "\\\"") + text = unicode.replace(text, "\n", "\\n") in_reply_to_status_id = "" if message.inReplyTostatusId is not None: @@ -164,7 +166,7 @@ class Controller(QtCore.QObject): if message.isPrivate: isPrivate = "true" - func = "tentia_instance.sendNewMessage(\"{}\", \"{}\", \"{}\", {}, {}, {});".format(text, in_reply_to_status_id, in_reply_to_entity, locationObject, imageFilePath, isPrivate) + func = ("tentia_instance.sendNewMessage(\"" + text + "\", \"{}\", \"{}\", {}, {}, {});").format( in_reply_to_status_id, in_reply_to_entity, locationObject, imageFilePath, isPrivate) self.app.timeline.evaluateJavaScript(func) @QtCore.pyqtSlot(str, str) diff --git a/Linux/Windows.py b/Linux/Windows.py index 63fbe26..d76f8f9 100644 --- a/Linux/Windows.py +++ b/Linux/Windows.py @@ -349,7 +349,7 @@ class NewPost(Helper.RestorableWindow): count = 256 - len(self.textInput.toPlainText()) if count >= 0: message = Helper.PostModel() - message.text = self.textInput.toPlainText() + message.text = unicode(self.textInput.toPlainText().toUtf8(), "utf-8") message.inReplyTostatusId = self.status_id message.inReplyToEntity = self.reply_to_entity message.location = None