From 31a769edba9d64c63a9e5e28112ec8d2d9065ac6 Mon Sep 17 00:00:00 2001 From: "dietrich@mozilla.com" Date: Fri, 28 Mar 2008 11:10:18 -0700 Subject: [PATCH] Bug 417264 ? Bookmarks with Japanese characters are not imported from Safari (r=mano) --- .../components/migration/src/nsSafariProfileMigrator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/browser/components/migration/src/nsSafariProfileMigrator.cpp b/browser/components/migration/src/nsSafariProfileMigrator.cpp index c1ae035dda4..7328a77f80b 100644 --- a/browser/components/migration/src/nsSafariProfileMigrator.cpp +++ b/browser/components/migration/src/nsSafariProfileMigrator.cpp @@ -1022,15 +1022,16 @@ nsSafariProfileMigrator::ParseBookmarksFolder(CFArrayRef aChildren, // Encountered a Bookmark, so add it to the current folder... CFDictionaryRef URIDictionary = (CFDictionaryRef) ::CFDictionaryGetValue(entry, CFSTR("URIDictionary")); - nsCAutoString title, url; - if (GetDictionaryCStringValue(URIDictionary, CFSTR("title"), title, kCFStringEncodingUTF8) && + nsAutoString title; + nsCAutoString url; + if (GetDictionaryStringValue(URIDictionary, CFSTR("title"), title) && GetDictionaryCStringValue(entry, CFSTR("URLString"), url, kCFStringEncodingUTF8)) { nsCOMPtr uri; - PRInt64 id; rv |= NS_NewURI(getter_AddRefs(uri), url); + PRInt64 id; rv |= aBookmarksService->InsertBookmark(aParentFolder, uri, nsINavBookmarksService::DEFAULT_INDEX, - title, &id); + NS_ConvertUTF16toUTF8(title), &id); } } }