OSDN Git Service

Unicode fix for editing source HTML.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / NoteTable.java
index 6e919f4..bd27b1d 100644 (file)
@@ -210,15 +210,7 @@ public class NoteTable {
                }\r
        }\r
 \r
                }\r
        }\r
 \r
-       // Get a note's content in raw, binary format for the sync.\r
-       public String getNoteContentBinary(String guid) {\r
-               NSqlQuery query = new NSqlQuery(db.getConnection());\r
-               query.prepare("Select content from note where guid=:guid");\r
-               query.bindValue(":guid", guid);\r
-               query.exec();           \r
-               query.next();\r
-               return query.valueString(0);\r
-       }\r
+\r
        // Get a note's content in blob format for index.\r
        public String getNoteContentNoUTFConversion(String guid) {\r
                NSqlQuery query = new NSqlQuery(db.getConnection());\r
        // Get a note's content in blob format for index.\r
        public String getNoteContentNoUTFConversion(String guid) {\r
                NSqlQuery query = new NSqlQuery(db.getConnection());\r
@@ -542,7 +534,9 @@ public class NoteTable {
                        logger.log(logger.MEDIUM, query.lastError());\r
                }\r
                \r
                        logger.log(logger.MEDIUM, query.lastError());\r
                }\r
                \r
-               query.bindValue(":content", content);\r
+               QTextCodec codec = QTextCodec.codecForLocale();\r
+               codec = QTextCodec.codecForName("UTF-8");\r
+               query.bindValue(":content", codec.fromUnicode(content).toString());\r
                query.bindValue(":guid", guid);\r
 \r
                check = query.exec();\r
                query.bindValue(":guid", guid);\r
 \r
                check = query.exec();\r