From eef9509ff16df41dfc6cfc76dec6ce0daf9a7452 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Jul 2025 14:56:54 +1000 Subject: [PATCH] UI: respect UI_BUT_NO_UTF8 for text buttons This was already handled by most accessors. --- source/blender/editors/interface/interface.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/interface/interface.cc b/source/blender/editors/interface/interface.cc index c33311f3f4d..7564aedd224 100644 --- a/source/blender/editors/interface/interface.cc +++ b/source/blender/editors/interface/interface.cc @@ -3084,7 +3084,12 @@ void ui_but_string_get_ex(uiBut *but, } else if (ELEM(but->type, ButType::Text, ButType::SearchMenu)) { /* string */ - BLI_strncpy(str, but->poin, str_maxncpy); + if (UI_but_is_utf8(but)) { + BLI_strncpy_utf8(str, but->poin, str_maxncpy); + } + else { + BLI_strncpy(str, but->poin, str_maxncpy); + } return; } else if (ui_but_anim_expression_get(but, str, str_maxncpy)) { @@ -3407,7 +3412,12 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str) } else if (but->type == ButType::SearchMenu) { /* string */ - BLI_strncpy(but->poin, str, but->hardmax); + if (UI_but_is_utf8(but)) { + BLI_strncpy_utf8(but->poin, str, but->hardmax); + } + else { + BLI_strncpy(but->poin, str, but->hardmax); + } return true; } else if (ui_but_anim_expression_set(but, str)) {