Skip to content

Commit

Permalink
Merge pull request #75814 from timothyqiu/connect-unicode
Browse files Browse the repository at this point in the history
Fix connect signal dialog not allowing Unicode method name
  • Loading branch information
YuriSizov authored Apr 10, 2023
2 parents 5243f5c + 936c9e8 commit 220953b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/connections_dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void ConnectDialog::ok_pressed() {
return;
}

if (!method_name.strip_edges().is_valid_identifier()) {
if (!TS->is_valid_identifier(method_name.strip_edges())) {
error->set_text(TTR("Method name must be a valid identifier."));
error->popup_centered();
return;
Expand Down Expand Up @@ -228,7 +228,7 @@ StringName ConnectDialog::generate_method_callback_name(Node *p_source, String p
String node_name = p_source->get_name();
for (int i = 0; i < node_name.length(); i++) { // TODO: Regex filter may be cleaner.
char32_t c = node_name[i];
if (!is_ascii_identifier_char(c)) {
if ((i == 0 && !is_unicode_identifier_start(c)) || (i > 0 && !is_unicode_identifier_continue(c))) {
if (c == ' ') {
// Replace spaces with underlines.
c = '_';
Expand Down

0 comments on commit 220953b

Please sign in to comment.