summaryrefslogtreecommitdiffstats
path: root/base/i18n/file_util_icu.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/i18n/file_util_icu.cc')
-rw-r--r--base/i18n/file_util_icu.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/base/i18n/file_util_icu.cc b/base/i18n/file_util_icu.cc
index 0c7c09d..f44af10 100644
--- a/base/i18n/file_util_icu.cc
+++ b/base/i18n/file_util_icu.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -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