diff options
Diffstat (limited to 'src/common/plugin.c')
-rw-r--r-- | src/common/plugin.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/common/plugin.c b/src/common/plugin.c index b0eef41d..5ef20de8 100644 --- a/src/common/plugin.c +++ b/src/common/plugin.c @@ -970,9 +970,7 @@ hexchat_printf (hexchat_plugin *ph, const char *format, ...) void hexchat_command (hexchat_plugin *ph, const char *command) { - char *command_nonconst; - char *conv; - gssize len = -1; + char *command_utf8; if (!is_session (ph->context)) { @@ -981,11 +979,9 @@ hexchat_command (hexchat_plugin *ph, const char *command) } /* scripts/plugins continue to send non-UTF8... *sigh* */ - command_nonconst = g_strdup (command); - conv = text_validate (&command_nonconst, &len); - handle_command (ph->context, command_nonconst, FALSE); - g_free (conv); - g_free (command_nonconst); + command_utf8 = text_invalid_encoding_to_utf8 (command, -1, "UTF-8", NULL); + handle_command (ph->context, command_utf8, FALSE); + g_free (command_utf8); } void |