Mercurial > audlegacy
comparison src/audacious/strings.c @ 2787:e35538325145 trunk
[svn] - add some assertions to chardet_to_utf8() to try to trace bad g_convert() calls
author | nenolod |
---|---|
date | Wed, 23 May 2007 15:45:00 -0700 |
parents | b474ecb5bde4 |
children | a2d234851527 |
comparison
equal
deleted
inserted
replaced
2786:c539e972b514 | 2787:e35538325145 |
---|---|
192 str_to_utf8(const gchar * str) | 192 str_to_utf8(const gchar * str) |
193 { | 193 { |
194 gchar *out_str; | 194 gchar *out_str; |
195 | 195 |
196 /* NULL in NULL out */ | 196 /* NULL in NULL out */ |
197 if (!str) | 197 g_return_val_if_fail(str != NULL, NULL); |
198 return NULL; | |
199 | 198 |
200 /* Note: Currently, playlist calls this function repeatedly, even | 199 /* Note: Currently, playlist calls this function repeatedly, even |
201 * if the string is already converted into utf-8. | 200 * if the string is already converted into utf-8. |
202 * chardet_to_utf8() would convert a valid utf-8 string into a | 201 * chardet_to_utf8() would convert a valid utf-8 string into a |
203 * different utf-8 string, if fallback encodings were supplied and | 202 * different utf-8 string, if fallback encodings were supplied and |
275 gsize my_bytes_read, my_bytes_write; | 274 gsize my_bytes_read, my_bytes_write; |
276 | 275 |
277 bytes_read = arg_bytes_read ? arg_bytes_read : &my_bytes_read; | 276 bytes_read = arg_bytes_read ? arg_bytes_read : &my_bytes_read; |
278 bytes_write = arg_bytes_write ? arg_bytes_write : &my_bytes_write; | 277 bytes_write = arg_bytes_write ? arg_bytes_write : &my_bytes_write; |
279 error = arg_error ? arg_error : NULL; | 278 error = arg_error ? arg_error : NULL; |
279 | |
280 g_return_val_if_fail(str != NULL, NULL); | |
280 | 281 |
281 #ifdef USE_CHARDET | 282 #ifdef USE_CHARDET |
282 if(cfg.chardet_detector) | 283 if(cfg.chardet_detector) |
283 det = cfg.chardet_detector; | 284 det = cfg.chardet_detector; |
284 | 285 |