Changeset d783e48


Ignore:
Timestamp:
2006-03-31T08:53:53Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
e27661d
Parents:
755ae5b
Message:

irc_vawrite() does charset conversion now. Next step: Do it for incoming IRC
traffic, and get rid of most other iconv() calls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc.c

    r755ae5b rd783e48  
    563563{
    564564        int size;
    565         char line[IRC_MAX_LINE];
    566        
     565        char line[IRC_MAX_LINE+1], *cs;
     566               
    567567        if( irc->quit )
    568568                return;
    569 
    570         g_vsnprintf( line, IRC_MAX_LINE - 3, format, params );
    571 
     569       
     570        line[IRC_MAX_LINE] = 0;
     571        g_vsnprintf( line, IRC_MAX_LINE - 2, format, params );
     572       
    572573        strip_newlines( line );
     574        if( ( cs = set_getstr( irc, "charset" ) ) )
     575        {
     576                char conv[IRC_MAX_LINE+1];
     577               
     578                conv[IRC_MAX_LINE] = 0;
     579                if( do_iconv( "UTF-8", cs, line, conv, 0, IRC_MAX_LINE - 2 ) != -1 )
     580                        strcpy( line, conv );
     581        }
    573582        strcat( line, "\r\n" );
    574 
     583       
    575584        if( irc->sendbuffer != NULL ) {
    576585                size = strlen( irc->sendbuffer ) + strlen( line );
Note: See TracChangeset for help on using the changeset viewer.