diff options
Diffstat (limited to 'irc_channel.c')
-rw-r--r-- | irc_channel.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/irc_channel.c b/irc_channel.c index 3de68e34..cbd306a3 100644 --- a/irc_channel.c +++ b/irc_channel.c @@ -592,6 +592,16 @@ char *irc_channel_name_gen(irc_t *irc, const char *hint) gsize bytes_written; translit_name = g_convert_with_fallback(hint, -1, "ASCII//TRANSLIT", "UTF-8", "", NULL, &bytes_written, NULL); + + if (!translit_name) { + /* Same thing as in nick_gen() in nick.c, try again without //TRANSLIT */ + translit_name = g_convert_with_fallback(hint, -1, "ASCII", "UTF-8", "", NULL, &bytes_written, NULL); + } + + if (!translit_name) { + return NULL; + } + if (bytes_written > MAX_NICK_LENGTH) { translit_name[MAX_NICK_LENGTH] = '\0'; } |