From: Randy Baumgarte Date: Sun, 3 Apr 2011 15:30:23 +0000 (-0400) Subject: Add HTML Entities fix for Android. X-Git-Tag: version0.1.1~165 X-Git-Url: http://git.sourceforge.jp/view?p=neighbornote%2FNeighborNote.git;a=commitdiff_plain;h=9c3fe65bded19147ae4b8ff37c279048f6ff702c;ds=sidebyside Add HTML Entities fix for Android. --- diff --git a/src/cx/fbn/nevernote/sql/NoteTable.java b/src/cx/fbn/nevernote/sql/NoteTable.java index f0529ca..c25d125 100644 --- a/src/cx/fbn/nevernote/sql/NoteTable.java +++ b/src/cx/fbn/nevernote/sql/NoteTable.java @@ -27,6 +27,8 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import org.apache.commons.lang.StringEscapeUtils; + import com.evernote.edam.type.Note; import com.evernote.edam.type.NoteAttributes; import com.evernote.edam.type.Resource; @@ -308,7 +310,11 @@ public class NoteTable { QTextCodec codec = QTextCodec.codecForLocale(); codec = QTextCodec.codecForName("UTF-8"); String unicode = codec.fromUnicode(query.valueString(16)).toString(); - n.setContent(unicode); + + if (Global.enableHTMLEntitiesFix) + unicode = codec.fromUnicode(StringEscapeUtils.unescapeXml(query.valueString(16).toString())).toString(); + + n.setContent(unicode); // n.setContent(query.valueString(16).toString()); String contentHash = query.valueString(17);