1 diff -Nur old/dillorc new/dillorc
2 --- old/dillorc 2004-01-25 16:18:12.000000000 +0100
3 +++ new/dillorc 2004-03-07 17:42:28.000000000 +0100
5 # If you prefer oblique over italic fonts, uncoment next line
8 +# Use this value as charset part of font for loading. (default is iso8859-1)
9 +# font_charset=iso8859-5
11 # Show tooltip popup for images?
12 # Note: We use the "title" attribute and not "alt".
13 # More info at: http://bugzilla.mozilla.org/show_bug.cgi?id=25537
14 diff -Nur old/encodings new/encodings
15 --- old/encodings 1970-01-01 01:00:00.000000000 +0100
16 +++ new/encodings 2004-03-07 17:32:50.000000000 +0100
18 +<enc value="ASCII">7-bit ASCII</enc>
19 +<enc value="ISO8859-1">Western European (ISO 8859-1)</enc>
20 +<enc value="ISO8859-15">Western European (ISO 8859-15)</enc>
21 +<enc value="CP1252">Western European (CodePage1252)</enc>
22 +<enc value="ISO8859-2">Central European (ISO 8859-2)</enc>
23 +<enc value="CP1250">Central European (CodePage1250)</enc>
24 +<enc value="ISO8859-3">Southern European (ISO 8859-3)</enc>
25 +<enc value="KOI8-R">Cyrillic (KOI8-R)</enc>
26 +<enc value="CP1251">Cyrillic (CodePage1251)</enc>
27 +<enc value="IBM866">Cyrillic (IBM866)</enc>
28 +<enc value="ISO8859-13">Baltic (ISO 8859-13)</enc>
29 +<enc value="ISO8859-4">Baltic (ISO 8859-4)</enc>
30 +<enc value="CP1257">Baltic (CodePage1257)</enc>
31 +<enc value="ISO8859-10">Nordic (ISO 8859-10)</enc>
32 +<enc value="ISO8859-14">Celtic (ISO 8859-14)</enc>
33 +<enc value="KOI8-U">Ukraine (KOI8-U)</enc>
34 +<enc value="UTF-8">Unicode (UTF-8)</enc>
35 +<enc value="UTF-16">Unicode (UTF-16)</enc>
36 diff -Nur old/src/browser.h new/src/browser.h
37 --- old/src/browser.h 2004-02-03 20:03:28.000000000 +0100
38 +++ new/src/browser.h 2004-03-07 17:45:51.000000000 +0100
40 #include <sys/types.h>
44 #include "url.h" /* for DilloUrl */
46 +#include "encodings-types.h"
48 typedef struct _BrowserWindow BrowserWindow;
49 typedef struct _DilloMenuPopup DilloMenuPopup;
51 /* Popup menu for this BrowserWindow */
52 DilloMenuPopup menu_popup;
54 + /* The encoding menu */
55 + GtkWidget *enc_menu;
57 /* The "Headings" and "Anchors" menus */
58 GtkWidget *pagemarks_menuitem;
59 GtkWidget *pagemarks_menu;
62 /* The id for the idle function that sets button sensitivity. */
65 + /* encodings variable */
66 + gchar* encoding; /* the selected character set (pointer to static content -don't free it*/
67 + deConversion dcv; /* handle for character set conversion */
71 diff -Nur old/src/dillo.c new/src/dillo.c
72 --- old/src/dillo.c 2004-02-06 16:53:59.000000000 +0100
73 +++ new/src/dillo.c 2004-03-07 19:43:48.000000000 +0100
79 +#include <langinfo.h>
80 +#if ! defined(CODESET) && defined (_NL_CTYPE_CODESET_NAME)
81 +#define CODESET _NL_CTYPE_CODESET_NAME
85 #include <sys/types.h>
92 +#include "encodings.h"
98 gint main(int argc, char *argv[])
100 - gchar *dir, *curr_locale;
101 + gchar *dir, *loctmp;
106 gint xpos = D_GEOMETRY_DEFAULT_XPOS, ypos = D_GEOMETRY_DEFAULT_YPOS;
107 gint width = D_GEOMETRY_DEFAULT_WIDTH, height = D_GEOMETRY_DEFAULT_HEIGHT;
110 - curr_locale = g_strdup(setlocale(LC_ALL, NULL));
112 /* Initialize GUI and parse GTK related args */
113 gtk_init(&argc, &argv);
119 - /* Send a delayed locale-related message */
120 - MSG("Setting locale to %s...\n", curr_locale);
121 - g_free(curr_locale);
122 + curr_locale=gtk_set_locale();
123 +#ifdef HAVE_LANGINFO
124 + curr_locale = nl_langinfo(CODESET);
126 + loctmp = strchr(curr_locale, '.');
127 + if (loctmp != NULL) {
128 + gchar** trk = g_strsplit(++loctmp, ";", 1);
129 + curr_locale = g_strdup(trk[0]);
132 + curr_locale = "ASCII";
136 + g_print("Setting locale to %s\n",curr_locale);
138 /* This lets threads in the file module end peacefully when aborted
139 * todo: implement a cleaner mechanism (in file.c) */
141 gtk_widget_set_uposition(bw->main_window, prefs.xpos, prefs.ypos);
144 + a_Encodings_init();
146 /* Send dillo startup screen */
147 start_url = a_Url_new("splash", "about:", 0, 0, 0);
148 diff -Nur old/src/dillo.h new/src/dillo.h
149 --- old/src/dillo.h 2003-09-05 14:07:06.000000000 +0200
150 +++ new/src/dillo.h 2004-03-07 19:26:40.000000000 +0100
156 extern gboolean dillo_dbg_rendering;
158 #endif /* __DILLO_H__ */
159 diff -Nur old/src/dw_style.c new/src/dw_style.c
160 --- old/src/dw_style.c 2003-11-15 22:57:53.000000000 +0100
161 +++ new/src/dw_style.c 2004-03-07 19:34:53.000000000 +0100
164 #include "dw_style.h"
165 #include "dw_widget.h"
170 @@ -300,40 +301,37 @@
174 - sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-iso8859-1",
175 + sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-%s",
177 (font->weight >= 500) ? "bold" : "medium",
178 - style_char_1, font->size);
179 + style_char_1, font->size, prefs.font_charset);
180 font->font = gdk_font_load (fontname);
182 if (font->font == NULL && font->style != DW_STYLE_FONT_STYLE_NORMAL) {
183 - sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-iso8859-1",
184 + sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-%s",
186 (font->weight >= 500) ? "bold" : "medium",
187 - style_char_2, font->size);
188 + style_char_2, font->size, prefs.font_charset);
189 font->font = gdk_font_load (fontname);
193 if (font->font == NULL) {
194 /* Can't load the font - substitute the default instead. */
197 - ("-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1");
198 + sprintf(fontname,"-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-%s", prefs.font_charset);
199 + font->font = gdk_font_load (fontname);
202 if (font->font == NULL) {
203 /* Try another platform-font that should be available. (iPaq) */
206 - ("-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1");
207 + sprintf(fontname,"-misc-fixed-medium-r-normal--13-120-75-75-c-80-%s", prefs.font_charset);
208 + font->font = gdk_font_load (fontname);
211 if (font->font == NULL) {
212 /* Can't load any suitable font! */
213 - g_warning ("Can't load any ISO8859-1 font!?! :(");
215 - gdk_font_load ("-adobe-helvetica-*-*-*--*-*-*-*-*-*-*-*");
216 + g_warning ("Can't load any font with charset '%s'!?! :(",prefs.font_charset);
217 + font->font = gdk_fontset_load("-adobe-helvetica-*-*-*--*-*-*-*-*-*-*-*,-misc-fixed-*,*");
221 diff -Nur old/src/encodings.c new/src/encodings.c
222 --- old/src/encodings.c 1970-01-01 01:00:00.000000000 +0100
223 +++ new/src/encodings.c 2004-03-07 17:32:50.000000000 +0100
227 +/* Copyright (C) 2002 Grigory Bakunov <black@asplinux.ru> */
229 +/* Copyright (C) 1997 Ian Main
231 + * This program is free software; you can redistribute it and/or modify
232 + * it under the terms of the GNU General Public License as published by
233 + * the Free Software Foundation; either version 2 of the License, or
234 + * (at your option) any later version.
236 + * This program is distributed in the hope that it will be useful,
237 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
238 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
239 + * GNU General Public License for more details.
241 + * You should have received a copy of the GNU General Public License
242 + * along with this program; if not, write to the Free Software
243 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
246 +#include <gtk/gtk.h>
255 +#include "interface.h"
258 +#include "browser.h"
263 +#define LOAD_ENCODINGS 1
264 +#define SAVE_ENCODING 2
265 +#define CLOSE_ENCODINGS 3
267 +/* this #define will cut page title if > 39 chars */
271 +#define D_QUOTE 0x22
275 +typedef struct _Encoding Encoding;
276 +typedef struct _CallbackInfo CallbackInfo;
281 + GtkWidget *menuitem;
284 +struct _CallbackInfo {
290 + * Forward declarations
293 + Encodings_load_to_menu(FILE *fp),
294 + Encodings_file_op(gint operation, const char *title, const char *iconv_name),
295 + Encodings_save_to_file(FILE *fp, const char *title, const char *iconv_name);
298 + Encodings_search_line(char *line, char *start_text, char *end_text);
300 +extern BrowserWindow **browser_window;
305 +static Encoding *encodings = NULL;
306 +static gint num_encodings = 0;
307 +static gint num_encodings_max = 16;
311 + * Allocate memory and load the encodings list
313 +void a_Encodings_init(void)
317 + /* Here we load and set the encodings */
318 + file = a_Misc_prepend_user_home(".dillo/encodings");
319 + if (access(file, R_OK))
320 + Encodings_file_op(LOAD_ENCODINGS, "/etc/dillo/encodings", NULL);
322 + Encodings_file_op(LOAD_ENCODINGS, file, NULL);
329 +void Encodings_set_encoding(GtkWidget *widget, CallbackInfo *CbInfo)
331 + if (CbInfo->index >= num_encodings) {
332 + g_warning("encoding not found!\n");
335 + g_print("Selected encoding: %s\n",encodings[CbInfo->index].iconv_name);
336 + CbInfo->bw->encoding=encodings[CbInfo->index].iconv_name;
337 + a_Nav_reload(CbInfo->bw);
338 + /*HERE!!! LOOKOUT!!!! */
342 + * Add a encoding to the encodings menu of a particular browser window
344 +void Encodings_add_to_menu(BrowserWindow *bw, GtkWidget *menuitem, guint index)
346 + CallbackInfo *CbInfo;
348 + gtk_menu_append(GTK_MENU(bw->enc_menu), menuitem);
350 + CbInfo = g_new(CallbackInfo, 1);
352 + CbInfo->index = index;
354 + /* accelerator goes here */
355 + gtk_signal_connect(GTK_OBJECT (menuitem), "activate",
356 + (GtkSignalFunc)Encodings_set_encoding, CbInfo);
362 +static GtkWidget *Encodings_insert(const char *title, const char *iconv_name)
364 + GtkWidget *menuitem;
366 + menuitem = gtk_menu_item_new_with_label(title);
367 + gtk_widget_show(menuitem);
369 + a_List_add(encodings, num_encodings, num_encodings_max);
370 + encodings[num_encodings].title = g_strdup(title);
371 + encodings[num_encodings].iconv_name = g_strdup(iconv_name);
372 + encodings[num_encodings].menuitem = menuitem;
378 + * Add the new encoding to encodings menu of _all_ browser windows and then
379 + * write the new encoding to file
382 +void a_Encodings_add(GtkWidget *widget, gpointer client_data)
384 + BrowserWindow *bw = (BrowserWindow *)client_data;
387 + gboolean allocated = FALSE;
391 + GtkWidget *menuitem;
393 + title = bw->menu_popup.info.title;
394 + iconv_name = bw->menu_popup.info.iconv_name;
397 + if (strlen (title) > 39) {
401 + memcpy (buf1, title, 18);
403 + strcpy (buf2, title + strlen (title) - 18);
405 + title = g_strconcat (buf1, "...", buf2, NULL);
410 + menuitem = Encodings_insert(title, iconv_name);
411 + Encodings_add_to_menu(browser_window[0], menuitem, num_encodings-1);
412 + for (i = 1; i < num_bw; i++) {
413 + menuitem= gtk_menu_item_new_with_label(encodings[num_encodings-1].title);
414 + gtk_widget_show(menuitem);
415 + Encodings_add_to_menu(browser_window[i], menuitem, num_encodings-1);
418 + Encodings_file_op(SAVE_ENCODING, title, iconv_name);
427 + * Never called (the file remains open all the time) --Jcid
429 +void Encodings_close(void)
431 + Encodings_file_op(CLOSE_ENCODINGS, NULL, NULL);
435 + * Performs operations on the encoding file..
436 + * for first call, title is the filename
439 + Encodings_file_op(gint operation, const char *title, const char *iconv_name)
442 + static gint initialized = 0;
444 + if (!initialized) {
445 + if (operation == LOAD_ENCODINGS) {
446 + /* SAVE_ENCODINGS is broken anyway, better make use of /etc/dillo/encodings */
447 + if ((fp = fopen(title, "r")) == NULL)
448 + g_print("dillo: opening encoding file %s: %s\n",
449 + title, strerror(errno));
453 + g_print("Error: invalid call to Encodings_file_op.\n");
456 + g_return_if_fail( initialized );
458 + switch (operation) {
459 + case LOAD_ENCODINGS:
460 + Encodings_load_to_menu(fp);
463 + case SAVE_ENCODING:
464 + Encodings_save_to_file(fp, title, iconv_name);
467 + case CLOSE_ENCODINGS:
477 + * Save encodings to ~/.dillo/encodings
480 + Encodings_save_to_file(FILE *fp, const char *title, const char* iconv_name)
482 + fseek(fp, 0L, SEEK_END);
483 + fprintf(fp, "<enc value=\"%s\">%s</a>\n", iconv_name,title);
490 +static void Encodings_load_to_menu(FILE *fp)
493 + gchar *iconv_name=NULL;
496 + GtkWidget *menuitem;
500 + g_print("Loading encodings...\n");
502 + /* Read a whole line from the file */
503 + if ((fgets(buf, 4096, fp)) == NULL)
506 + /* get url from line */
507 + if ( !(iconv_name = Encodings_search_line(buf, "=\"", "\">")) )
510 + /* get title from line */
511 + if ( !(title = Encodings_search_line(buf, "\">", "</")) ){
512 + g_free(iconv_name);
515 + printf("%s = %s\n",title,iconv_name);
516 + menuitem = Encodings_insert(title, iconv_name);
517 + Encodings_add_to_menu(browser_window[0], menuitem, i);
518 + g_free(iconv_name);
525 + * Copy encodings when new browser windows are opened.
526 + * Called by 'a_Menu_mainbar_new()'
528 +void a_Encodings_fill_new_menu(BrowserWindow *bw)
531 + GtkWidget *menuitem;
533 + for (i = 0; i < num_encodings; i++) {
534 + menuitem = gtk_menu_item_new_with_label(encodings[i].title);
535 + gtk_widget_show(menuitem);
536 + Encodings_add_to_menu(bw, menuitem, i);
541 + Encodings_search_line(char *line, char *start_text, char *end_text) {
542 + gint segment_length;
543 + char *start_index, *end_index;
545 + /* if string is not found, return NULL */
546 + if ((start_index = strstr(line, start_text)) == NULL)
548 + if ((end_index = strstr(line, end_text)) == NULL)
551 + /* adjustment cause strstr returns the start of the text */
552 + start_index += strlen(start_text);
554 + /* find length of text segment */
555 + segment_length = end_index - start_index;
556 + return g_strndup(start_index, segment_length);
559 +void a_Encoding_get_conversion(BrowserWindow *bw, char* charset) {
560 + bw->dcv.c_from=iconv_open(curr_locale,charset);
561 + bw->dcv.c_to=iconv_open(charset,curr_locale);
562 + if (bw->dcv.c_from == (iconv_t)-1 || bw->dcv.c_to == (iconv_t)-1)
563 + g_warning ("could not allocate character encoding converter.");
567 +#define MAX_CHAR_SIZE 4
568 +gchar *a_Encoding_translate_encoding(deConversion dcv, gchar *buf, gint bufsize,deDirection dir) {
569 + char *result, *source, *dest;
570 + size_t s_left, d_left;
571 + iconv_t conversion;
572 + if (dir==DE_DECODE)
573 + conversion=dcv.c_from;
575 + conversion=dcv.c_to;
576 + /* no conversion is needed, or none is available */
577 + if (conversion == (iconv_t)-1)
578 + return g_strndup(buf, bufsize);
580 + /* Note that for some conversions, the translated buffer can be larger
581 + * than the input buffer. This is particularly important for conversions
582 + * to UTF8 (check the unicode standard to find out the scale factor). */
583 + result = g_malloc((bufsize + 1)*MAX_CHAR_SIZE);
588 + d_left = bufsize*MAX_CHAR_SIZE;
589 + if (iconv(conversion, &source, &s_left, &dest, &d_left)
591 + g_warning ("unable to fully convert page to native character set");
592 + /* This just skips past unconvertable characters, putting "?" in the
593 + * output, then retries the conversion. This is a hack, but it seems
594 + * like the best course of action in the circumstances. */
595 + while (s_left > 0 && d_left > 0 && errno == EILSEQ) {
601 + if (s_left > 0 && d_left > 0)
602 + iconv(conversion, &source, &s_left, &dest, &d_left);
605 + *dest = 0; /* terminate the string */
608 diff -Nur old/src/encodings.h new/src/encodings.h
609 --- old/src/encodings.h 1970-01-01 01:00:00.000000000 +0100
610 +++ new/src/encodings.h 2004-03-07 17:32:50.000000000 +0100
612 +#ifndef __DILLO_ENCODING_H__
613 +#define __DILLO_ENCODING_H__
614 +#include <gtk/gtk.h>
616 +#include "browser.h"
617 +#include "encodings-types.h"
620 +/* Copyright (C) 2002 Grigory Bakunov <black@asplinux.ru> */
622 +void a_Encodings_init();
623 +void a_Encodings_add(GtkWidget *widget, gpointer client_data);
624 +void a_Encodings_fill_new_menu(BrowserWindow *bw);
625 +void a_Encoding_get_conversion(BrowserWindow *bw, char* charset);
626 +char *a_Encoding_translate_encoding(deConversion dcv, char *buf,
627 + gint bufsize,deDirection dir);
629 +#endif /* __DILLO_ENCODING_H__ */
630 diff -Nur old/src/encodings-types.h new/src/encodings-types.h
631 --- old/src/encodings-types.h 1970-01-01 01:00:00.000000000 +0100
632 +++ new/src/encodings-types.h 2004-03-07 17:32:50.000000000 +0100
634 +#ifndef __DILLO_ENCODING_TYPES_H__
635 +#define __DILLO_ENCODING_TYPES_H__
637 +/* Copyright (C) 2002 Grigory Bakunov <black@asplinux.ru> */
639 +typedef struct _deConversion deConversion;
641 +struct _deConversion {
652 +#endif /* __DILLO_ENCODING_TYPES_H__ */
653 diff -Nur old/src/html.c new/src/html.c
654 --- old/src/html.c 2004-02-07 00:10:45.000000000 +0100
655 +++ new/src/html.c 2004-03-07 18:21:23.000000000 +0100
657 #include "progressbar.h"
660 +#include "encodings.h"
664 @@ -3140,7 +3142,7 @@
665 if ((form->method == DILLO_HTML_METHOD_GET) ||
666 (form->method == DILLO_HTML_METHOD_POST)) {
667 GString *DataStr = g_string_sized_new(4096);
669 + GString *DataStrEnc;
670 DEBUG_MSG(3,"Html_submit_form form->action=%s\n",URL_STR_(form->action));
672 for (input_index = 0; input_index < form->num_inputs; input_index++) {
673 @@ -3204,6 +3206,12 @@
677 + DataStrEnc = g_string_new(a_Encoding_translate_encoding(html_lb->bw->dcv,
681 + g_string_free(DataStr,TRUE);
682 + DataStr = DataStrEnc;
684 if ( DataStr->str[DataStr->len - 1] == '&' )
685 g_string_truncate(DataStr, DataStr->len - 1);
686 @@ -4374,6 +4382,22 @@
687 Html_write(Client->CbData, Client->Buf, Client->BufSize, 0);
690 +static void Html_set_encoding(DilloHtml *html, char *buf, gint bufsize) {
691 + /* only do _anything_ if told so */
692 + if (html->bw->encoding != NULL)
693 + a_Encoding_get_conversion(html->bw, html->bw->encoding);
697 +static char *Html_translate_encoding(DilloHtml *html, char *buf,
699 + char* result=a_Encoding_translate_encoding(html->bw->dcv,
707 * Here's where we parse the html and put it into the page structure.
708 * Return value: number of bytes parsed
709 @@ -4511,8 +4535,12 @@
711 g_return_if_fail ( (page = DW_PAGE (html->dw)) != NULL );
713 + Html_set_encoding(html, buf, bufsize);
714 + buf = Html_translate_encoding(html, buf, bufsize);
716 html->Start_Buf = Buf;
717 token_start = Html_write_raw(html, buf, bufsize, Eof);
719 html->Start_Ofs += token_start;
722 diff -Nur old/src/interface.c new/src/interface.c
723 --- old/src/interface.c 2004-02-03 20:10:42.000000000 +0100
724 +++ new/src/interface.c 2004-03-07 18:22:51.000000000 +0100
727 /* BrowserWindow holds all the widgets (and perhaps more)
728 * for each new_browser.*/
729 -static BrowserWindow **browser_window;
730 +BrowserWindow **browser_window;
731 static gint num_bw, num_bw_max;
733 /* We need only one of them. */
735 bw->question_dialog_window = NULL;
736 bw->question_dialog_data = NULL;
737 bw->viewsource_window = NULL;
739 + bw->dcv.c_from = (iconv_t)-1; /* no conversion yet */
740 + bw->dcv.c_to = (iconv_t)-1;
741 bw->pagebugs_window = NULL;
743 /* now that the bw is made, let's customize it.. */
744 diff -Nur old/src/Makefile.am new/src/Makefile.am
745 --- old/src/Makefile.am 2004-01-29 21:34:05.000000000 +0100
746 +++ new/src/Makefile.am 2004-03-07 18:32:22.000000000 +0100
757 diff -Nur old/src/menu.c new/src/menu.c
758 --- old/src/menu.c 2004-02-03 20:03:11.000000000 +0100
759 +++ new/src/menu.c 2004-03-07 18:26:30.000000000 +0100
761 #include "bookmark.h"
762 #include "interface.h"
764 +#include "encodings.h"
765 #include "selection.h"
770 GtkWidget *file_menu;
771 /* GtkWidget *help_menu; */
772 + GtkWidget *enc_menu;
774 bw->menubar = menubar = gtk_menu_bar_new();
777 Menu_add(help_menu, "Dillo _Home", NULL, bw,
778 a_Commands_helphome_callback, bw);
780 + enc_menu = Menu_new(menubar, tiny ? "_E" : "_Encodings", FALSE, bw);
781 + bw->enc_menu = enc_menu;
782 + a_Encodings_fill_new_menu(bw);
787 diff -Nur old/src/prefs.c new/src/prefs.c
788 --- old/src/prefs.c 2004-01-25 16:17:53.000000000 +0100
789 +++ new/src/prefs.c 2004-03-07 18:30:13.000000000 +0100
791 { "small_icons", DRC_TOKEN_SMALL_ICONS },
792 { "limit_text_width", DRC_TOKEN_LIMIT_TEXT_WIDTH },
793 { "font_factor", DRC_TOKEN_FONT_FACTOR },
794 + { "font_charset", DRC_TOKEN_FONT_CHARSET },
795 { "use_dicache", DRC_TOKEN_USE_DICACHE },
796 { "show_back", DRC_TOKEN_SHOW_BACK },
797 { "show_forw", DRC_TOKEN_SHOW_FORW },
799 case DRC_TOKEN_FONT_FACTOR:
800 prefs.font_factor = strtod(scanner->value.v_string, NULL);
802 + case DRC_TOKEN_FONT_CHARSET:
803 + if (prefs.font_charset) g_free(prefs.font_charset);
804 + prefs.font_charset = g_strdup(scanner->value.v_string);
806 case DRC_TOKEN_LIMIT_TEXT_WIDTH:
807 prefs.limit_text_width = (strcmp(scanner->value.v_string, "YES") == 0);
810 prefs.small_icons = FALSE;
811 prefs.limit_text_width = FALSE;
812 prefs.font_factor = 1.0;
813 + prefs.font_charset = g_strdup("iso8859-1");
814 prefs.use_dicache = FALSE;
815 prefs.show_back=TRUE;
816 prefs.show_forw=TRUE;
818 g_free(prefs.no_proxy);
819 if (prefs.no_proxy_vec)
820 g_strfreev(prefs.no_proxy_vec);
821 + if (prefs.font_charset)
822 + g_free (prefs.font_charset);
823 a_Url_free(prefs.http_proxy);
824 g_free(prefs.fw_fontname);
825 g_free(prefs.vw_fontname);
826 diff -Nur old/src/prefs.h new/src/prefs.h
827 --- old/src/prefs.h 2004-01-25 16:17:37.000000000 +0100
828 +++ new/src/prefs.h 2004-03-07 18:31:25.000000000 +0100
830 DRC_TOKEN_PANEL_SIZE,
831 DRC_TOKEN_SMALL_ICONS,
832 DRC_TOKEN_FONT_FACTOR,
833 + DRC_TOKEN_FONT_CHARSET,
834 DRC_TOKEN_SHOW_TOOLTIP,
835 DRC_TOKEN_LIMIT_TEXT_WIDTH,
836 DRC_TOKEN_USE_DICACHE,
838 gboolean small_icons;
839 gboolean limit_text_width;
841 + char *font_charset;
842 gboolean use_dicache;