summaryrefslogtreecommitdiffstats
path: root/chrome/browser/importer
diff options
context:
space:
mode:
authordsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 01:21:09 +0000
committerdsh@google.com <dsh@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-03 01:21:09 +0000
commitdbf476de0ef1cdcc11c5f2d689b8755809a857fb (patch)
tree5a68c5a8fb056c10441752dcd230e96180d1e775 /chrome/browser/importer
parente1b01fc18365da2c58cc17981bf28fe71fd06b7e (diff)
downloadchromium_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')
-rw-r--r--chrome/browser/importer/firefox2_importer.cc17
-rw-r--r--chrome/browser/importer/importer.cc5
2 files changed, 16 insertions, 6 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"&lt;", L"<");
- ReplaceSubstringsAfterOffset(text, 0, L"&gt;", L">");
- ReplaceSubstringsAfterOffset(text, 0, L"&amp;", L"&");
- ReplaceSubstringsAfterOffset(text, 0, L"&quot;", L"\"");
- ReplaceSubstringsAfterOffset(text, 0, L"&#39;", L"\'");
+ string16 text16 = WideToUTF16Hack(*text);
+ ReplaceSubstringsAfterOffset(
+ &text16, 0, ASCIIToUTF16("&lt;"), ASCIIToUTF16("<"));
+ ReplaceSubstringsAfterOffset(
+ &text16, 0, ASCIIToUTF16("&gt;"), ASCIIToUTF16(">"));
+ ReplaceSubstringsAfterOffset(
+ &text16, 0, ASCIIToUTF16("&amp;"), ASCIIToUTF16("&"));
+ ReplaceSubstringsAfterOffset(
+ &text16, 0, ASCIIToUTF16("&quot;"), ASCIIToUTF16("\""));
+ ReplaceSubstringsAfterOffset(
+ &text16, 0, ASCIIToUTF16("&#39;"), ASCIIToUTF16("\'"));
+ text->assign(UTF16ToWideHack(text16));
}
// static
diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc
index 9c98362..2d3f924 100644
--- a/chrome/browser/importer/importer.cc
+++ b/chrome/browser/importer/importer.cc
@@ -667,7 +667,10 @@ void ImporterHost::DetectFirefoxProfiles() {
std::wstring is_relative, path, profile_path;
if (root.GetString(current_profile + L".IsRelative", &is_relative) &&
root.GetString(current_profile + L".Path", &path)) {
- ReplaceSubstringsAfterOffset(&path, 0, L"/", L"\\");
+ string16 path16 = WideToUTF16Hack(path);
+ ReplaceSubstringsAfterOffset(
+ &path16, 0, ASCIIToUTF16("/"), ASCIIToUTF16("\\"));
+ path.assign(UTF16ToWideHack(path16));
#if defined(OS_WIN)
// IsRelative=1 means the folder path would be relative to the