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

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: test case 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
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..db749c65950dbf5eb9344819ecd8ec0844422f7c 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 NormalizeFileNameOnChromeOS(FilePath* file_name) {
asanka 2012/03/26 22:08:35 Could you also toss in a quick unit test in file_u
tbarzic 2012/03/26 22:57:26 Done.
+#if defined(OS_CHROMEOS)
+ std::string normalized_str;
+ if (base::ConvertToUtf8AndNormalize(file_name->value(),
+ base::kCodepageUTF8,
+ &normalized_str)) {
+ *file_name = FilePath(normalized_str);
+ }
+#endif
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698