diff options
author | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 01:21:09 +0000 |
---|---|---|
committer | dsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-03 01:21:09 +0000 |
commit | dbf476de0ef1cdcc11c5f2d689b8755809a857fb (patch) | |
tree | 5a68c5a8fb056c10441752dcd230e96180d1e775 /chrome/browser/importer/firefox2_importer.cc | |
parent | e1b01fc18365da2c58cc17981bf28fe71fd06b7e (diff) | |
download | chromium_src-dbf476de0ef1cdcc11c5f2d689b8755809a857fb.zip chromium_src-dbf476de0ef1cdcc11c5f2d689b8755809a857fb.tar.gz chromium_src-dbf476de0ef1cdcc11c5f2d689b8755809a857fb.tar.bz2 |
Port Replace(First)SubstringsAfterOffset to string16.
Review URL: http://codereview.chromium.org/28324
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10767 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer/firefox2_importer.cc')
-rw-r--r-- | chrome/browser/importer/firefox2_importer.cc | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/chrome/browser/importer/firefox2_importer.cc b/chrome/browser/importer/firefox2_importer.cc index 77fd49f..8dfddd2 100644 --- a/chrome/browser/importer/firefox2_importer.cc +++ b/chrome/browser/importer/firefox2_importer.cc @@ -501,11 +501,18 @@ bool Firefox2Importer::GetAttribute(const std::string& attribute_list, // static void Firefox2Importer::HTMLUnescape(std::wstring *text) { - ReplaceSubstringsAfterOffset(text, 0, L"<", L"<"); - ReplaceSubstringsAfterOffset(text, 0, L">", L">"); - ReplaceSubstringsAfterOffset(text, 0, L"&", L"&"); - ReplaceSubstringsAfterOffset(text, 0, L""", L"\""); - ReplaceSubstringsAfterOffset(text, 0, L"'", L"\'"); + string16 text16 = WideToUTF16Hack(*text); + ReplaceSubstringsAfterOffset( + &text16, 0, ASCIIToUTF16("<"), ASCIIToUTF16("<")); + ReplaceSubstringsAfterOffset( + &text16, 0, ASCIIToUTF16(">"), ASCIIToUTF16(">")); + ReplaceSubstringsAfterOffset( + &text16, 0, ASCIIToUTF16("&"), ASCIIToUTF16("&")); + ReplaceSubstringsAfterOffset( + &text16, 0, ASCIIToUTF16("""), ASCIIToUTF16("\"")); + ReplaceSubstringsAfterOffset( + &text16, 0, ASCIIToUTF16("'"), ASCIIToUTF16("\'")); + text->assign(UTF16ToWideHack(text16)); } // static |