Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ICU support data loading #97648

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading