View | Details | Raw Unified | Return to bug 45741
Collapse All | Expand All

(-)/tmp/centericq/files/patch-msnhook.cc (-11 / +15 lines)
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
+
(-)/tmp/centericq/files/patch-utf8conv.h (-3 / +5 lines)
Lines 1-13 Link Here
1
--- src/hooks/utf8conv.h	Thu Jan  1 08:00:00 1970
1
--- src/hooks/utf8conv.h	Thu Jan  1 08:00:00 1970
2
+++ src/hooks/utf8conv.h	Tue Nov 19 15:19:44 2002
2
+++ src/hooks/utf8conv.h	Tue Nov 26 16:10:40 2002
3
@@ -0,0 +1,56 @@
3
@@ -0,0 +1,58 @@
4
+/*-------------------------------------------------------*/
4
+/*-------------------------------------------------------*/
5
+/* utf8conv.h     ( Utf8 Converter )                     */
5
+/* utf8conv.h     ( Utf8 Converter )                     */
6
+/*-------------------------------------------------------*/
6
+/*-------------------------------------------------------*/
7
+/* target : Converting Utf8 from/to string/char          */
7
+/* target : Converting Utf8 from/to string/char          */
8
+/* modifier : clsung@dragon2.net                         */
8
+/* modifier : clsung@dragon2.net                         */
9
+/* create : unknown                                      */
9
+/* create : unknown                                      */
10
+/* update : 02/11/19                                     */
10
+/* update : 02/11/26                                     */
11
+/*-------------------------------------------------------*/
11
+/*-------------------------------------------------------*/
12
+#ifndef _UTF8CONV_
12
+#ifndef _UTF8CONV_
13
+#define _UTF8CONV_
13
+#define _UTF8CONV_
Lines 21-28 Link Here
21
+#endif
21
+#endif
22
+#include <string>
22
+#include <string>
23
+#define DEFAULT_CHARSET "ISO-8859-1"
23
+#define DEFAULT_CHARSET "ISO-8859-1"
24
+#define UTF8_BUF_LENGTH 2048
24
+/* charset name cache buffer */
25
+/* charset name cache buffer */
25
+static char loc_charset[32];
26
+static char loc_charset[32];
27
+static char utf8_buf[UTF8_BUF_LENGTH]; // max 401 length or per message
26
+/* 
28
+/* 
27
+** Name:    safe_iconv
29
+** Name:    safe_iconv
28
+** Purpose: 'Fault-tolerant' version if iconv. Replaces invalid seq with '?'
30
+** Purpose: 'Fault-tolerant' version if iconv. Replaces invalid seq with '?'

Return to bug 45741