OSDN Git Service

Add HTML Entities fix for Android.
authorRandy Baumgarte <randy@fbn.cx>
Sun, 3 Apr 2011 15:30:23 +0000 (11:30 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Sun, 3 Apr 2011 18:03:41 +0000 (14:03 -0400)
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 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
 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
                        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
 //                     n.setContent(query.valueString(16).toString());\r
                        \r
                        String contentHash = query.valueString(17);\r