diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 00:00:51 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-09 00:00:51 +0000 |
commit | 83612103b1b205d2456049ed4c5bde50af70fb2e (patch) | |
tree | 797c84b99190a52aabdcf3d8ddb21c14baf01d40 /net | |
parent | 66515f81c6c13eecfc7aabe13eed9949e7bd8e67 (diff) | |
download | chromium_src-83612103b1b205d2456049ed4c5bde50af70fb2e.zip chromium_src-83612103b1b205d2456049ed4c5bde50af70fb2e.tar.gz chromium_src-83612103b1b205d2456049ed4c5bde50af70fb2e.tar.bz2 |
revert r49217, which caused unit test failures on win:
Download filename encoding fix:
Fall back on other charsets when using the URL to suggest a filename. The URL should be escaped UTF-8, but may use another encoding instead.
BUG=44301
TEST=see bug.
Review URL: http://codereview.chromium.org/2775002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49219 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/base/net_util.cc | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/base/net_util.cc b/net/base/net_util.cc index 490feab..60f626d4 100644 --- a/net/base/net_util.cc +++ b/net/base/net_util.cc @@ -1081,7 +1081,7 @@ FilePath GetSuggestedFilename(const GURL& url, } const std::string filename_from_cd = GetFileNameFromCD(content_disposition, - referrer_charset); + referrer_charset); #if defined(OS_WIN) FilePath::StringType filename = UTF8ToWide(filename_from_cd); #elif defined(OS_POSIX) @@ -1102,17 +1102,10 @@ FilePath GetSuggestedFilename(const GURL& url, const std::string unescaped_url_filename = UnescapeURLComponent( url.ExtractFileName(), UnescapeRule::SPACES | UnescapeRule::URL_SPECIAL_CHARS); - - // The URL should be escaped UTF-8, but may not be. - std::string decoded_filename; - bool ignore; - DecodeWord(unescaped_url_filename, referrer_charset, &ignore, - &decoded_filename); - #if defined(OS_WIN) - filename = UTF8ToWide(decoded_filename); + filename = UTF8ToWide(unescaped_url_filename); #elif defined(OS_POSIX) - filename = decoded_filename; + filename = unescaped_url_filename; #endif } } |