Merge pull request #397 from kmark/title-decode-fix

Decode HTML entities in titles
This commit is contained in:
Sean Owen 2015-05-23 10:07:29 +01:00
commit 5561322512

View file

@ -16,6 +16,7 @@
package com.google.zxing.client.android.result.supplement;
import android.text.Html;
import android.widget.TextView;
import com.google.zxing.client.android.HttpHelper;
import com.google.zxing.client.android.history.HistoryManager;
@ -56,6 +57,7 @@ final class TitleRetriever extends SupplementalInfoRetriever {
if (m.find()) {
String title = m.group(1);
if (title != null && !title.isEmpty()) {
title = Html.fromHtml(title).toString();
if (title.length() > MAX_TITLE_LEN) {
title = title.substring(0, MAX_TITLE_LEN) + "...";
}