diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2007-12-02 17:27:46 +0000 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2007-12-02 17:27:46 +0000 |
commit | fc5d06d4540894bafbc681c586f2b8aa5142357f (patch) | |
tree | 9a598d4b036d92347bc0e4aa27ff1dd5fe47edb0 | |
parent | 5bd21df87b195af211c2280ca00391493a669895 (diff) | |
parent | 94d52d64c1ad3d55f210e1fc8e6345d54c4e46d5 (diff) |
Merging a change I should've pulled before committing three other changes.
-rw-r--r-- | irc.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -319,11 +319,22 @@ void irc_process( irc_t *irc ) break; } - if( ( cs = set_getstr( &irc->set, "charset" ) ) && ( g_strcasecmp( cs, "utf-8" ) != 0 ) ) + if( ( cs = set_getstr( &irc->set, "charset" ) ) ) { conv[IRC_MAX_LINE] = 0; - if( do_iconv( cs, "UTF-8", lines[i], conv, 0, IRC_MAX_LINE - 2 ) != -1 ) - lines[i] = conv; + if( do_iconv( cs, "UTF-8", lines[i], conv, 0, IRC_MAX_LINE - 2 ) == -1 ) + { + if( irc->status & USTATUS_LOGGED_IN ) + irc_usermsg( irc, "ERROR: Charset mismatch detected. The charset " + "setting is currently set to %s, so please make " + "sure your IRC client will send and accept text in " + "that charset, or tell BitlBee which charset to " + "expect by changing the charset setting. See " + "`help set charset' for more information. Your " + "message was ignored.", cs ); + *conv = 0; + } + lines[i] = conv; } if( ( cmd = irc_parse_line( lines[i] ) ) == NULL ) |