How to embed the ICU data file into my application?

1,196 views
Skip to first unread message

Darin Dimitrov

unread,
Jun 11, 2019, 11:12:52 AM6/11/19
to v8-users
I have built V8 with the "v8_enable_i18n_support=true" gn flag and I can successfully initialize it by providing the location of the "icudtl.dat" file (created during the v8 build process):

bool success = V8::InitializeICU("/path_to/icudtl.dat");

I was wondering if instead of providing the location of this file on the file system, it is possible to pass a pointer to the contents? I would like to somehow embed this file into my application.

For example for the V8 heap snapshot there are the "V8::SetNativesDataBlob" and "V8::SetSnapshotDataBlob" APIs which allow me to directly pass a pointer to "natives_blob.bin" and "snapshot_blob.bin" file contents and I don't need to distribute them separately.

By looking at the InitializeICU https://chromium.googlesource.com/v8/v8.git/+/refs/heads/master/src/init/icu_util.cc#65  method I couldn't find any way to achieve this.

Ben Noordhuis

unread,
Jun 12, 2019, 12:27:34 PM6/12/19
to v8-users
You can, with some effort. See this thread from last month:

https://groups.google.com/forum/#!msg/v8-users/XjHbF1xMD8E/IMEGQBhpBAAJ
Reply all
Reply to author
Forward
0 new messages