diff snownews-1.5.3/config.h snownews-1.5.3-localcharset/config.h *** snownews-1.5.3/config.h Sat Jun 5 01:38:57 2004 --- snownews-1.5.3-localcharset/config.h Sat Jun 5 22:32:11 2004 *************** *** 29,34 **** --- 29,35 ---- #ifndef TARGET_CHARSET #define TARGET_CHARSET "ISO-8859-1" #endif + extern char * target_charset; struct feed { char *feedurl; /* Non hashified URL */ *************** *** 113,118 **** --- 114,126 ---- }; extern struct feed *first_ptr; + + #include + #ifdef HAVE_NL_LANGINFO + #include + #else + #include + #endif #ifdef LOCALEPATH # include diff snownews-1.5.3/interface.c snownews-1.5.3-localcharset/interface.c *** snownews-1.5.3/interface.c Sat Jun 5 01:38:57 2004 --- snownews-1.5.3-localcharset/interface.c Sat Jun 5 22:32:11 2004 *************** *** 106,112 **** and corrupt mem while resizing the window. */ newtext = UIDejunk (current_feed->description); ! converted = iconvert (newtext, "UTF-8", TARGET_CHARSET); if (converted == NULL) converted = strdup (newtext); --- 106,112 ---- and corrupt mem while resizing the window. */ newtext = UIDejunk (current_feed->description); ! converted = iconvert (newtext, "UTF-8", target_charset); if (converted == NULL) converted = strdup (newtext); *************** *** 120,126 **** /* Print original feed's description and not "(New headlines)". */ if (current_feed->smartfeed == 1) { newtext = UIDejunk (current_item->data->parent->description); ! converted = iconvert (newtext, "UTF-8", TARGET_CHARSET); if (converted == NULL) converted = strdup (newtext); --- 120,126 ---- /* Print original feed's description and not "(New headlines)". */ if (current_feed->smartfeed == 1) { newtext = UIDejunk (current_item->data->parent->description); ! converted = iconvert (newtext, "UTF-8", target_charset); if (converted == NULL) converted = strdup (newtext); *************** *** 142,148 **** /* And don't crash if title is empty. */ if (current_item->data->title != NULL) { newtext = UIDejunk (current_item->data->title); ! converted = iconvert (newtext, "UTF-8", TARGET_CHARSET); if (converted == NULL) converted = strdup (newtext); --- 142,148 ---- /* And don't crash if title is empty. */ if (current_item->data->title != NULL) { newtext = UIDejunk (current_item->data->title); ! converted = iconvert (newtext, "UTF-8", target_charset); if (converted == NULL) converted = strdup (newtext); *************** *** 167,173 **** /* Only generate a new scroll list if we need to rewrap everything. Otherwise just skip this block. */ if (rewrap) { ! converted = iconvert (current_item->data->description, "UTF-8", TARGET_CHARSET); if (converted == NULL) converted = strdup (current_item->data->description); newtext = UIDejunk (converted); --- 167,173 ---- /* Only generate a new scroll list if we need to rewrap everything. Otherwise just skip this block. */ if (rewrap) { ! converted = iconvert (current_item->data->description, "UTF-8", target_charset); if (converted == NULL) converted = strdup (current_item->data->description); newtext = UIDejunk (converted); *************** *** 501,507 **** columns = COLS-10; newtext = UIDejunk (current_feed->description); ! converted = iconvert (newtext, "UTF-8", TARGET_CHARSET); if (converted == NULL) converted = strdup (newtext); --- 501,507 ---- columns = COLS-10; newtext = UIDejunk (current_feed->description); ! converted = iconvert (newtext, "UTF-8", target_charset); if (converted == NULL) converted = strdup (newtext); *************** *** 559,565 **** } else newtext = UIDejunk (curitem_ptr->data->title); ! converted = iconvert (newtext, "UTF-8", TARGET_CHARSET); if (converted == NULL) converted = strdup (newtext); --- 559,565 ---- } else newtext = UIDejunk (curitem_ptr->data->title); ! converted = iconvert (newtext, "UTF-8", target_charset); if (converted == NULL) converted = strdup (newtext); diff snownews-1.5.3/main.c snownews-1.5.3-localcharset/main.c *** snownews-1.5.3/main.c Sat Jun 5 01:38:57 2004 --- snownews-1.5.3-localcharset/main.c Sat Jun 5 22:32:11 2004 *************** *** 49,54 **** --- 49,56 ---- extern struct feed *first_bak; /* For use with the signal handler. */ extern char *browser; + char * target_charset = TARGET_CHARSET; + /* Deinit ncurses and quit. */ void MainQuit (char * func, char * error) { if (error == NULL) { *************** *** 479,487 **** int main (int argc, char *argv[]) { int autoupdate = 0; /* Automatically update feeds on app start... or not if set to 0. */ int numfeeds; /* Number of feeds loaded from Config(). */ ! ! #ifdef LOCALEPATH setlocale (LC_ALL, ""); bindtextdomain ("snownews", LOCALEPATH); textdomain ("snownews"); #endif --- 481,494 ---- int main (int argc, char *argv[]) { int autoupdate = 0; /* Automatically update feeds on app start... or not if set to 0. */ int numfeeds; /* Number of feeds loaded from Config(). */ ! setlocale (LC_ALL, ""); + #ifdef HAVE_NL_LANGINFO + target_charset = nl_langinfo(CODESET); + #else + target_charset = locale_charset(); + #endif + #ifdef LOCALEPATH bindtextdomain ("snownews", LOCALEPATH); textdomain ("snownews"); #endif