Index: src/icu_util.cc |
diff --git a/src/icu_util.cc b/src/icu_util.cc |
index 02251306c86e9d4421525bd84780d0f6751d52b3..a6f0453fc23e95145b1965eb3688e6968551f7f4 100644 |
--- a/src/icu_util.cc |
+++ b/src/icu_util.cc |
@@ -15,6 +15,8 @@ |
#include "unicode/putil.h" |
#include "unicode/udata.h" |
+#include "src/base/file-utils.h" |
+ |
#define ICU_UTIL_DATA_FILE 0 |
#define ICU_UTIL_DATA_SHARED 1 |
#define ICU_UTIL_DATA_STATIC 2 |
@@ -38,6 +40,26 @@ void free_icu_data_ptr() { |
} // namespace |
#endif |
+bool InitializeICUDefaultLocation(const char* exec_path, |
+ const char* icu_data_file) { |
+#if !defined(V8_I18N_SUPPORT) |
+ return true; |
+#else |
+#if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE |
+ if (icu_data_file) { |
+ return InitializeICU(icu_data_file); |
+ } |
+ char* icu_data_file_default; |
+ RelativePath(&icu_data_file_default, exec_path, "icudtl.dat"); |
+ bool result = InitializeICU(icu_data_file_default); |
+ free(icu_data_file_default); |
+ return result; |
+#else |
+ return InitializeICU(NULL); |
+#endif |
+#endif |
+} |
+ |
bool InitializeICU(const char* icu_data_file) { |
#if !defined(V8_I18N_SUPPORT) |
return true; |