Lines 1-5
Link Here
|
1 |
--- src/hooks/msnhook.cc Mon Nov 24 10:16:27 2002 |
1 |
--- src/hooks/msnhook.cc Mon Oct 28 19:29:41 2002 |
2 |
+++ src/hooks/msnhook.cc Mon Nov 25 10:16:27 2002 |
2 |
+++ src/hooks/msnhook.cc Tue Nov 26 16:10:34 2002 |
3 |
@@ -30,6 +30,7 @@ |
3 |
@@ -30,6 +30,7 @@ |
4 |
#include "eventmanager.h" |
4 |
#include "eventmanager.h" |
5 |
#include "centericq.h" |
5 |
#include "centericq.h" |
Lines 39-45
Link Here
|
39 |
em.store(immessage(ic, imevent::incoming, text)); |
39 |
em.store(immessage(ic, imevent::incoming, text)); |
40 |
|
40 |
|
41 |
if(c) |
41 |
if(c) |
42 |
@@ -453,3 +456,132 @@ |
42 |
@@ -453,3 +456,136 @@ |
43 |
clist.get(contactroot)->playsound(imevent::email); |
43 |
clist.get(contactroot)->playsound(imevent::email); |
44 |
} |
44 |
} |
45 |
} |
45 |
} |
Lines 68-73
Link Here
|
68 |
+ return loc_charset; |
68 |
+ return loc_charset; |
69 |
+ |
69 |
+ |
70 |
+ lang = getenv("LANG"); |
70 |
+ lang = getenv("LANG"); |
|
|
71 |
+ if (!lang) { |
72 |
+ strcpy( loc_charset, DEFAULT_CHARSET ); |
73 |
+ return loc_charset; |
74 |
+ }; |
71 |
+ ch = strrchr( lang, '.' ); |
75 |
+ ch = strrchr( lang, '.' ); |
72 |
+ if (!ch) |
76 |
+ if (!ch) |
73 |
+ strcpy( loc_charset, DEFAULT_CHARSET ); |
77 |
+ strcpy( loc_charset, DEFAULT_CHARSET ); |
Lines 91-98
Link Here
|
91 |
+char *StrToUtf8( const char *inbuf ) |
95 |
+char *StrToUtf8( const char *inbuf ) |
92 |
+{ |
96 |
+{ |
93 |
+ size_t length = strlen( inbuf ); |
97 |
+ size_t length = strlen( inbuf ); |
94 |
+ size_t outmaxlength = length * 4; /* FIXME: Is x4 multiplier enoght? */ |
98 |
+ size_t outmaxlength = UTF8_BUF_LENGTH; |
95 |
+ char *outbuf = (char*) malloc( outmaxlength + 1 ); |
99 |
+ char *outbuf = utf8_buf; |
96 |
+ char *outbuf_save = outbuf; |
100 |
+ char *outbuf_save = outbuf; |
97 |
+ int ret; |
101 |
+ int ret; |
98 |
+ |
102 |
+ |
Lines 111-119
Link Here
|
111 |
+std::string StrToUtf8( const std::string &instr ) |
115 |
+std::string StrToUtf8( const std::string &instr ) |
112 |
+{ |
116 |
+{ |
113 |
+ size_t length = instr.length(); |
117 |
+ size_t length = instr.length(); |
114 |
+ size_t outmaxlength = length * 4; /* FIXME: Is x4 multiplier enoght? */ |
118 |
+ size_t outmaxlength = UTF8_BUF_LENGTH; |
115 |
+ const char *inbuf = instr.c_str(); |
119 |
+ const char *inbuf = instr.c_str(); |
116 |
+ char *outbuf = (char*) malloc( outmaxlength + 1 ); |
120 |
+ char *outbuf = utf8_buf; |
117 |
+ char *outbuf_save = outbuf; |
121 |
+ char *outbuf_save = outbuf; |
118 |
+ int ret; |
122 |
+ int ret; |
119 |
+ |
123 |
+ |
Lines 134-141
Link Here
|
134 |
+char *Utf8ToStr( const char *inbuf ) |
138 |
+char *Utf8ToStr( const char *inbuf ) |
135 |
+{ |
139 |
+{ |
136 |
+ size_t length = strlen( inbuf ); |
140 |
+ size_t length = strlen( inbuf ); |
137 |
+ size_t outmaxlength = length; |
141 |
+ size_t outmaxlength = UTF8_BUF_LENGTH / 4; |
138 |
+ char *outbuf = (char*) malloc( outmaxlength + 1 ); |
142 |
+ char *outbuf = utf8_buf; |
139 |
+ char *outbuf_save = outbuf; |
143 |
+ char *outbuf_save = outbuf; |
140 |
+ int ret; |
144 |
+ int ret; |
141 |
+ |
145 |
+ |
Lines 153-161
Link Here
|
153 |
+std::string Utf8ToStr( const std::string &instr ) |
157 |
+std::string Utf8ToStr( const std::string &instr ) |
154 |
+{ |
158 |
+{ |
155 |
+ size_t length = instr.length(); |
159 |
+ size_t length = instr.length(); |
156 |
+ size_t outmaxlength = length; |
|
|
157 |
+ const char *inbuf = instr.c_str(); |
160 |
+ const char *inbuf = instr.c_str(); |
158 |
+ char *outbuf = (char*) malloc( outmaxlength + 1 ); |
161 |
+ size_t outmaxlength = UTF8_BUF_LENGTH / 4; |
|
|
162 |
+ char *outbuf = utf8_buf; |
159 |
+ char *outbuf_save = outbuf; |
163 |
+ char *outbuf_save = outbuf; |
160 |
+ int ret; |
164 |
+ int ret; |
161 |
+ |
165 |
+ |