aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--irc.c10
-rw-r--r--root_commands.c8
2 files changed, 6 insertions, 12 deletions
diff --git a/irc.c b/irc.c
index 0d308912..f6a1f505 100644
--- a/irc.c
+++ b/irc.c
@@ -354,6 +354,8 @@ void irc_process( irc_t *irc )
for( i = 0; *lines[i] != '\0'; i ++ )
{
+ char conv[IRC_MAX_LINE+1];
+
/* [WvG] Because irc_tokenize splits at every newline, the lines[] list
should end with an empty string. This is why this actually works.
Took me a while to figure out, Maurits. :-P */
@@ -366,13 +368,11 @@ void irc_process( irc_t *irc )
break;
}
- if( ( cs = set_getstr( irc, "charset" ) ) )
+ if( ( cs = set_getstr( irc, "charset" ) ) && ( g_strcasecmp( cs, "utf-8" ) != 0 ) )
{
- char conv[IRC_MAX_LINE+1];
-
conv[IRC_MAX_LINE] = 0;
if( do_iconv( cs, "UTF-8", lines[i], conv, 0, IRC_MAX_LINE - 2 ) != -1 )
- strcpy( lines[i], conv );
+ lines[i] = conv;
}
if( ( cmd = irc_parse_line( lines[i] ) ) == NULL )
@@ -587,7 +587,7 @@ void irc_vawrite( irc_t *irc, char *format, va_list params )
g_vsnprintf( line, IRC_MAX_LINE - 2, format, params );
strip_newlines( line );
- if( ( cs = set_getstr( irc, "charset" ) ) )
+ if( ( cs = set_getstr( irc, "charset" ) ) && ( g_strcasecmp( cs, "utf-8" ) != 0 ) )
{
char conv[IRC_MAX_LINE+1];
diff --git a/root_commands.c b/root_commands.c
index 36eec8c3..56260d26 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -752,15 +752,9 @@ static void cmd_nick( irc_t *irc, char **cmd )
}
else
{
- char utf8[1024];
-
irc_usermsg( irc, "Setting your name to `%s'", cmd[2] );
- if( g_strncasecmp( set_getstr( irc, "charset" ), "none", 4 ) != 0 &&
- do_iconv( set_getstr( irc, "charset" ), "UTF-8", cmd[2], utf8, 0, 1024 ) != -1 )
- a->gc->prpl->set_info( a->gc, utf8 );
- else
- a->gc->prpl->set_info( a->gc, cmd[2] );
+ a->gc->prpl->set_info( a->gc, cmd[2] );
}
}