Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(778)

Unified Diff: base/i18n/file_util_icu.cc

Issue 9854011: Normalize download file name on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/i18n/file_util_icu.h ('k') | base/i18n/file_util_icu_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/file_util_icu.cc
diff --git a/base/i18n/file_util_icu.cc b/base/i18n/file_util_icu.cc
index 0c7c09de340a4c98d86446e3966d65c1242e26e4..31e844b5035466b834567857aa168350e3163888 100644
--- a/base/i18n/file_util_icu.cc
+++ b/base/i18n/file_util_icu.cc
@@ -7,6 +7,7 @@
#include "base/i18n/file_util_icu.h"
#include "base/file_path.h"
+#include "base/i18n/icu_string_conversions.h"
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
@@ -199,4 +200,15 @@ bool LocaleAwareCompareFilenames(const FilePath& a, const FilePath& b) {
#endif
}
+void NormalizeFileNameEncoding(FilePath* file_name) {
+#if defined(OS_CHROMEOS)
+ std::string normalized_str;
+ if (base::ConvertToUtf8AndNormalize(file_name->BaseName().value(),
+ base::kCodepageUTF8,
+ &normalized_str)) {
+ *file_name = file_name->DirName().Append(FilePath(normalized_str));
+ }
+#endif
+}
+
} // namespace
« no previous file with comments | « base/i18n/file_util_icu.h ('k') | base/i18n/file_util_icu_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698