[TextServer] Fix ICU data loading and exporting with internationalization/locale/include_text_server_data setting.

This commit is contained in:
bruvzg 2023-01-23 21:10:42 +02:00
parent c06df6779a
commit 15dafc49d3
No known key found for this signature in database
GPG key ID: 7960FCF39844EC38
3 changed files with 13 additions and 11 deletions

View file

@ -1294,7 +1294,9 @@ Error EditorExportPlatform::export_project_files(const Ref<EditorExportPreset> &
} else {
// Use default text server data.
String icu_data_file = EditorPaths::get_singleton()->get_cache_dir().path_join("tmp_icu_data");
TS->save_support_data(icu_data_file);
if (!TS->save_support_data(icu_data_file)) {
return ERR_INVALID_DATA;
}
Vector<uint8_t> array = FileAccess::get_file_as_bytes(icu_data_file);
err = p_func(p_udata, ts_data, array, idx, total, enc_in_filters, enc_ex_filters, key);
DirAccess::remove_file_or_error(icu_data_file);