diff --git a/starboard/client_porting/icu_init/icu_init.cc b/starboard/client_porting/icu_init/icu_init.cc index 35cf08ddd0eb..d2fca9df3bc1 100644 --- a/starboard/client_porting/icu_init/icu_init.cc +++ b/starboard/client_porting/icu_init/icu_init.cc @@ -33,24 +33,12 @@ namespace { // Once control for initializing ICU. pthread_once_t g_initialization_once = PTHREAD_ONCE_INIT; -// Initializes ICU and TimeZones so the rest of the functions will work. Should -// only be called once. +// Should only be called once. void Initialize() { - // Minimal Initialization of ICU. - std::vector base_path(kSbFileMaxPath); - bool result = SbSystemGetPath(kSbSystemPathContentDirectory, base_path.data(), - base_path.size()); - SB_DCHECK(result); - - std::string data_path(base_path.data()); - data_path += kSbFileSepString; - data_path += "icu"; - - // set this as the data directory. - u_setDataDirectory(data_path.c_str()); - UErrorCode err = U_ZERO_ERROR; - udata_setFileAccess(UDATA_PACKAGES_FIRST, &err); + + // ICU data is linked into the binary. + udata_setFileAccess(UDATA_NO_FILES, &err); SB_DCHECK(err <= U_ZERO_ERROR); } diff --git a/starboard/client_porting/icu_init/icu_init.h b/starboard/client_porting/icu_init/icu_init.h index 40553a19435a..bdc7856c162b 100644 --- a/starboard/client_porting/icu_init/icu_init.h +++ b/starboard/client_porting/icu_init/icu_init.h @@ -17,7 +17,7 @@ #if defined(STARBOARD) -// Initializes ICU using a standard path based on the Starboard content path. +// Does minimal initialization of ICU. // This function must be threadsafe and idempotent. Applications that wish to // initialize ICU differently may define their own IcuInit function rather // than using the implementation here. diff --git a/third_party/icu/source/common/udata.cpp b/third_party/icu/source/common/udata.cpp index e7cea1b7f8a0..f2bd38c81081 100644 --- a/third_party/icu/source/common/udata.cpp +++ b/third_party/icu/source/common/udata.cpp @@ -1367,6 +1367,11 @@ doOpenChoice(const char *path, const char *type, const char *name, /* Load from DLL. If we haven't attempted package load, we also haven't had any chance to try a DLL (static or setCommonData/etc) load. If we ever have a "UDATA_ONLY_FILES", add it to the or list here. */ +#if defined(STARBOARD) + /* To clarify, Cobalt links the common ICU package into the Cobalt binary. + So while this code path is followed, the data is not really loaded from + a DLL. */ +#endif // defined(STARBOARD) if(gDataFileAccess==UDATA_NO_FILES) { #ifdef UDATA_DEBUG fprintf(stderr, "Trying common data (UDATA_NO_FILES)\n");