Changeset 33b306e
- Timestamp:
- 2010-04-07T02:27:55Z (15 years ago)
- Branches:
- master
- Children:
- d4efddf
- Parents:
- 7815a2b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
irc.c
r7815a2b r33b306e 52 52 { 53 53 irc_t *irc = set->data; 54 char *test; 55 gsize test_bytes = 0; 54 56 GIConv ic, oc; 55 57 … … 57 59 value = g_strdup( "utf-8" ); 58 60 61 if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 ) 62 { 63 return NULL; 64 } 65 if( ( test = g_convert_with_iconv( " ", 1, oc, NULL, &test_bytes, NULL ) ) == NULL || 66 test_bytes > 1 ) 67 { 68 g_free( test ); 69 g_iconv_close( oc ); 70 irc_usermsg( irc, "Unsupported character set: The IRC protocol " 71 "only supports 8-bit character sets." ); 72 return NULL; 73 } 59 74 if( ( ic = g_iconv_open( "utf-8", value ) ) == (GIConv) -1 ) 60 75 { 61 return NULL; 62 } 63 if( ( oc = g_iconv_open( value, "utf-8" ) ) == (GIConv) -1 ) 64 { 65 g_iconv_close( ic ); 76 g_iconv_close( oc ); 66 77 return NULL; 67 78 }
Note: See TracChangeset
for help on using the changeset viewer.