Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/histolog.c @ 772:464be13343a9
Store most data in UTF-8 internally
Only chat buffer data is still using 1 byte for char size.
User input still doesn't handle UTF-8 locales.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sat, 25 Mar 2006 18:10:36 +0100 |
parents | 39f67cade02c |
children | 46304b773a44 |
comparison
equal
deleted
inserted
replaced
771:ce4f8a2129a4 | 772:464be13343a9 |
---|---|
213 // Remove last CR (we keep it if the line is empty, too) | 213 // Remove last CR (we keep it if the line is empty, too) |
214 if ((tail > data+26) && (*(tail-1) == '\n')) | 214 if ((tail > data+26) && (*(tail-1) == '\n')) |
215 *(tail-1) = 0; | 215 *(tail-1) = 0; |
216 | 216 |
217 if (type == 'M') { | 217 if (type == 'M') { |
218 char *converted; | |
218 if (info == 'S') | 219 if (info == 'S') |
219 prefix_flags = HBB_PREFIX_OUT | HBB_PREFIX_HLIGHT; | 220 prefix_flags = HBB_PREFIX_OUT | HBB_PREFIX_HLIGHT; |
220 else | 221 else |
221 prefix_flags = HBB_PREFIX_IN; | 222 prefix_flags = HBB_PREFIX_IN; |
222 xtext = ut_expand_tabs(&data[26]); // Expand tabs | 223 converted = from_utf8(&data[26]); |
223 hbuf_add_line(p_buddyhbuf, xtext, timestamp, prefix_flags, width); | 224 if (converted) { |
224 if (xtext != &data[26]) | 225 xtext = ut_expand_tabs(converted); // Expand tabs |
225 g_free(xtext); | 226 hbuf_add_line(p_buddyhbuf, xtext, timestamp, prefix_flags, width); |
227 if (xtext != converted) | |
228 g_free(xtext); | |
229 g_free(converted); | |
230 } | |
226 err = 0; | 231 err = 0; |
227 } | 232 } |
228 } | 233 } |
229 fclose(fp); | 234 fclose(fp); |
230 g_free(data); | 235 g_free(data); |