Changeset fc0cf92


Ignore:
Timestamp:
2008-01-13T00:15:12Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
07ff8a2
Parents:
59f527b6
Message:

Different handling of charset mismatches before login time. Ignoring a
USER command because of encoding issues isn't too great, so let's simply
replace them. The information isn't really used anywhere anyway.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r59f527b6 rfc0cf92  
    325325                                if( do_iconv( cs, "UTF-8", lines[i], conv, 0, IRC_MAX_LINE - 2 ) == -1 )
    326326                                {
     327                                        /* GLib can do strange things if things are not in the expected charset,
     328                                           so let's be a little bit paranoid here: */
    327329                                        if( irc->status & USTATUS_LOGGED_IN )
     330                                        {
    328331                                                irc_usermsg( irc, "Error: Charset mismatch detected. The charset "
    329332                                                                  "setting is currently set to %s, so please make "
     
    333336                                                                  "`help set charset' for more information. Your "
    334337                                                                  "message was ignored.", cs );
    335                                         *conv = 0;
     338                                                *conv = 0;
     339                                        }
     340                                        else
     341                                        {
     342                                                irc_write( irc, ":%s NOTICE AUTH :%s", irc->myhost,
     343                                                           "Warning: invalid (non-UTF8) characters received at login time." );
     344                                               
     345                                                strncpy( conv, lines[i], IRC_MAX_LINE );
     346                                                for( temp = conv; *temp; temp ++ )
     347                                                        if( *temp & 0x80 )
     348                                                                *temp = '?';
     349                                        }
    336350                                }
    337351                                lines[i] = conv;
Note: See TracChangeset for help on using the changeset viewer.