summaryrefslogtreecommitdiffstats
path: root/core/java/android/text/TextUtils.java
diff options
context:
space:
mode:
authorMarc Blank <mblank@google.com>2012-02-13 10:11:50 -0800
committerPaul Westbrook <pwestbro@google.com>2012-02-16 16:47:28 -0800
commit094bf51ec0911057263a27db4d79db4eface2d63 (patch)
tree5c5b542f3e13f760720035eaa438cf90d8cf2b42 /core/java/android/text/TextUtils.java
parent06a591cdd6d90600db006906d5d1524d156d6529 (diff)
downloadframeworks_base-094bf51ec0911057263a27db4d79db4eface2d63.zip
frameworks_base-094bf51ec0911057263a27db4d79db4eface2d63.tar.gz
frameworks_base-094bf51ec0911057263a27db4d79db4eface2d63.tar.bz2
Use &#39; for apostrophe in HTML encoding DO NOT MERGE
* We were using &apos; which is not correct Chery-pick of CL: https://android-git.corp.google.com/g/165367
Diffstat (limited to 'core/java/android/text/TextUtils.java')
-rw-r--r--core/java/android/text/TextUtils.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java
index 95a3cdc..43dfc81 100644
--- a/core/java/android/text/TextUtils.java
+++ b/core/java/android/text/TextUtils.java
@@ -1325,7 +1325,11 @@ public class TextUtils {
sb.append("&amp;"); //$NON-NLS-1$
break;
case '\'':
- sb.append("&apos;"); //$NON-NLS-1$
+ //http://www.w3.org/TR/xhtml1
+ // The named character reference &apos; (the apostrophe, U+0027) was introduced in
+ // XML 1.0 but does not appear in HTML. Authors should therefore use &#39; instead
+ // of &apos; to work as expected in HTML 4 user agents.
+ sb.append("&#39;"); //$NON-NLS-1$
break;
case '"':
sb.append("&quot;"); //$NON-NLS-1$