From f4832da16a9513e19881397abdbbf62285f8b852 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Mon, 13 Feb 2012 10:11:50 -0800 Subject: [PATCH] Use ' for apostrophe in HTML encoding * We were using ' which is not correct Change-Id: I4872da7d5e19f18ecd570dbcaac295020d66681c --- core/java/android/text/TextUtils.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/java/android/text/TextUtils.java b/core/java/android/text/TextUtils.java index 95a3cdc6ad8dc..43dfc8183ec67 100644 --- a/core/java/android/text/TextUtils.java +++ b/core/java/android/text/TextUtils.java @@ -1325,7 +1325,11 @@ public class TextUtils { sb.append("&"); //$NON-NLS-1$ break; case '\'': - sb.append("'"); //$NON-NLS-1$ + //http://www.w3.org/TR/xhtml1 + // The named character reference ' (the apostrophe, U+0027) was introduced in + // XML 1.0 but does not appear in HTML. Authors should therefore use ' instead + // of ' to work as expected in HTML 4 user agents. + sb.append("'"); //$NON-NLS-1$ break; case '"': sb.append("""); //$NON-NLS-1$