Skip to content

Commit

Permalink
Merge pull request godotengine#97648 from twrightsman/fix-icu-load
Browse files Browse the repository at this point in the history
Fix ICU support data loading
  • Loading branch information
akien-mga committed Oct 1, 2024
2 parents 79804a8 + c4b7d6f commit c73a18a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/text_server_adv/text_server_adv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,8 @@ bool TextServerAdvanced::_load_support_data(const String &p_filename) {
}
#else
if (!icu_data_loaded) {
UErrorCode err = U_ZERO_ERROR;
#ifdef ICU_DATA_NAME
String filename = (p_filename.is_empty()) ? String("res://") + _MKSTR(ICU_DATA_NAME) : p_filename;

Ref<FileAccess> f = FileAccess::open(filename, FileAccess::READ);
Expand All @@ -451,13 +453,13 @@ bool TextServerAdvanced::_load_support_data(const String &p_filename) {
uint64_t len = f->get_length();
icu_data = f->get_buffer(len);

UErrorCode err = U_ZERO_ERROR;
udata_setCommonData(icu_data.ptr(), &err);
if (U_FAILURE(err)) {
ERR_FAIL_V_MSG(false, u_errorName(err));
}

err = U_ZERO_ERROR;
#endif
u_init(&err);
if (U_FAILURE(err)) {
ERR_FAIL_V_MSG(false, u_errorName(err));
Expand Down

0 comments on commit c73a18a

Please sign in to comment.