8 |
* ### WeeChat - Wee Enhanced Environment for Chat ### |
* ### WeeChat - Wee Enhanced Environment for Chat ### |
9 |
* ### Fast & light environment for Chat ### |
* ### Fast & light environment for Chat ### |
10 |
* ### ### |
* ### ### |
11 |
* ### By: FlashCode <flashcode@flashtux.org> ### |
* ### By FlashCode <flashcode@flashtux.org> ### |
12 |
* ### Bounga <bounga@altern.org> ### |
### ### |
13 |
* ### Xahlexx <xahlexx@weeland.org> ### |
* ### http://weechat.flashtux.org ### |
|
* ### ### |
|
|
* ### http://weechat.flashtux.org ### |
|
14 |
* ### ### |
* ### ### |
15 |
* ############################################################################ |
* ############################################################################ |
16 |
* |
* |
47 |
#include <sys/stat.h> |
#include <sys/stat.h> |
48 |
#include <time.h> |
#include <time.h> |
49 |
#include <signal.h> |
#include <signal.h> |
50 |
|
|
51 |
|
#ifdef HAVE_ICONV |
52 |
#include <iconv.h> |
#include <iconv.h> |
53 |
|
#endif |
54 |
|
|
55 |
#include <langinfo.h> |
#include <langinfo.h> |
56 |
|
|
57 |
#include "weechat.h" |
#include "weechat.h" |
89 |
char * |
char * |
90 |
weechat_convert_encoding (char *from_code, char *to_code, char *string) |
weechat_convert_encoding (char *from_code, char *to_code, char *string) |
91 |
{ |
{ |
92 |
|
char *outbuf; |
93 |
|
|
94 |
|
#ifdef HAVE_ICONV |
95 |
iconv_t cd; |
iconv_t cd; |
96 |
char *inbuf, *ptr_inbuf, *outbuf, *ptr_outbuf; |
char *inbuf, *ptr_inbuf, *ptr_outbuf; |
97 |
int inbytesleft, outbytesleft; |
int inbytesleft, outbytesleft; |
98 |
|
|
99 |
if (from_code && from_code[0] && to_code && to_code[0] |
if (from_code && from_code[0] && to_code && to_code[0] |
124 |
} |
} |
125 |
else |
else |
126 |
outbuf = strdup (string); |
outbuf = strdup (string); |
127 |
|
#else |
128 |
|
/* make gcc happy */ |
129 |
|
(void) from_code; |
130 |
|
(void) to_code; |
131 |
|
outbuf = strdup (string); |
132 |
|
#endif /* HAVE_ICONV */ |
133 |
|
|
134 |
return outbuf; |
return outbuf; |
135 |
} |
} |