OSDN Git Service

Add HTML Entities fix for Android.
[neighbornote/NeighborNote.git] / src / cx / fbn / nevernote / sql / NoteTable.java
index f0529ca..c25d125 100644 (file)
@@ -27,6 +27,8 @@ import java.util.ArrayList;
 import java.util.HashMap;\r
 import java.util.List;\r
 \r
+import org.apache.commons.lang.StringEscapeUtils;\r
+\r
 import com.evernote.edam.type.Note;\r
 import com.evernote.edam.type.NoteAttributes;\r
 import com.evernote.edam.type.Resource;\r
@@ -308,7 +310,11 @@ public class NoteTable {
                        QTextCodec codec = QTextCodec.codecForLocale();\r
                        codec = QTextCodec.codecForName("UTF-8");\r
                String unicode =  codec.fromUnicode(query.valueString(16)).toString();\r
-                       n.setContent(unicode);\r
+\r
+               if (Global.enableHTMLEntitiesFix)\r
+                       unicode = codec.fromUnicode(StringEscapeUtils.unescapeXml(query.valueString(16).toString())).toString();\r
+               \r
+               n.setContent(unicode);\r
 //                     n.setContent(query.valueString(16).toString());\r
                        \r
                        String contentHash = query.valueString(17);\r