mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
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.
This commit is contained in:
parent
e3213aaef5
commit
c4b7d6f5c3
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user