diff options
author | Travis Wrightsman <travis@wrightsman.org> | 2024-09-30 09:03:15 -0700 |
---|---|---|
committer | Travis Wrightsman <travis@wrightsman.org> | 2024-09-30 09:03:15 -0700 |
commit | c4b7d6f5c32e2a241666233996f20af68107d0ba (patch) | |
tree | c50db7f8b8d63311eaa4058d01020498a47ca521 /modules | |
parent | e3213aaef5e0e72b8272e65d989d3d8222be17ca (diff) | |
download | redot-engine-c4b7d6f5c32e2a241666233996f20af68107d0ba.tar.gz |
Fix ICU support data loading
This fixes an error in loading the ICU support data on platforms that
don't use either the builtin icu4c or the static ICU support data.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/text_server_adv/text_server_adv.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/text_server_adv/text_server_adv.cpp b/modules/text_server_adv/text_server_adv.cpp index 3322300dda..e5639744d3 100644 --- a/modules/text_server_adv/text_server_adv.cpp +++ b/modules/text_server_adv/text_server_adv.cpp @@ -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); @@ -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)); |