1 --- dillo-0.7.0~/dillorc 2003-02-13 23:59:30 +0300
2 +++ dillo-0.7.0/dillorc 2003-02-21 03:15:45 +0300
4 # If you prefer oblique over italic fonts, uncoment next line
7 +# Use this value as charset part of font for loading. (default is iso8859-1)
8 +# font_charset=iso8859-5
10 # Show tooltip popup for images?
11 # Note: We use the "title" attribute and not "alt".
12 # More info at: http://bugzilla.mozilla.org/show_bug.cgi?id=25537
13 --- dillo-0.7.0~/encodings 1970-01-01 03:00:00 +0300
14 +++ dillo-0.7.0/encodings 2003-02-21 03:15:46 +0300
16 +<enc value="ASCII">7-bit ASCII</enc>
17 +<enc value="ISO8859-1">Western European (ISO 8859-1)</enc>
18 +<enc value="ISO8859-15">Western European (ISO 8859-15)</enc>
19 +<enc value="CP1252">Western European (CodePage1252)</enc>
20 +<enc value="ISO8859-2">Central European (ISO 8859-2)</enc>
21 +<enc value="CP1250">Central European (CodePage1250)</enc>
22 +<enc value="ISO8859-3">Southern European (ISO 8859-3)</enc>
23 +<enc value="KOI8-R">Cyrillic (KOI8-R)</enc>
24 +<enc value="CP1251">Cyrillic (CodePage1251)</enc>
25 +<enc value="IBM866">Cyrillic (IBM866)</enc>
26 +<enc value="ISO8859-13">Baltic (ISO 8859-13)</enc>
27 +<enc value="ISO8859-4">Baltic (ISO 8859-4)</enc>
28 +<enc value="CP1257">Baltic (CodePage1257)</enc>
29 +<enc value="ISO8859-10">Nordic (ISO 8859-10)</enc>
30 +<enc value="ISO8859-14">Celtic (ISO 8859-14)</enc>
31 +<enc value="KOI8-U">Ukraine (KOI8-U)</enc>
32 +<enc value="UTF-8">Unicode (UTF-8)</enc>
33 +<enc value="UTF-16">Unicode (UTF-16)</enc>
34 --- dillo-0.7.0~/Makefile.am 2003-02-13 23:56:11 +0300
35 +++ dillo-0.7.0/Makefile.am 2003-02-21 03:15:46 +0300
39 -EXTRA_DIST = ChangeLog.old dillorc
40 +EXTRA_DIST = ChangeLog.old dillorc encodings
42 install-data-local: dillorc
43 -if [ -d $(DESTDIR)$(sysconfdir) ]; then \
44 $(INSTALL_DATA) -b $(srcdir)/dillorc $(DESTDIR)$(sysconfdir)/; \
45 + $(INSTALL_DATA) --backup=t $(srcdir)/encodings $(DESTDIR)$(sysconfdir)/; \
46 elif [ -d /etc/ ]; then \
47 $(INSTALL_DATA) -b $(srcdir)/dillorc /etc/; \
48 + $(INSTALL_DATA) --backup=t $(srcdir)/encodings /etc/; \
52 -if [ -d $(DESTDIR)$(sysconfdir) ]; then \
53 rm -f $(DESTDIR)$(sysconfdir)/dillorc*; \
54 + rm -f $(DESTDIR)$(sysconfdir)/encodings*; \
55 elif [ -d /etc/ ]; then \
56 rm -f /etc/dillorc*; \
57 + rm -f /etc/encodings* ;\
59 --- dillo-0.7.0~/src/browser.h 2003-02-10 16:10:30 +0300
60 +++ dillo-0.7.0/src/browser.h 2003-02-21 03:15:46 +0300
62 #include <sys/types.h>
66 #include "url.h" /* for DilloUrl */
69 +#include "encodings-types.h"
70 typedef struct _BrowserWindow BrowserWindow;
71 typedef struct _DilloMenuPopup DilloMenuPopup;
74 /* The bookmarks menu so that we can add things to it. */
75 GtkWidget *bookmarks_menu;
77 + /* The encoding menu */
78 + GtkWidget *enc_menu;
80 /* The "Headings" and "Anchors" menus */
81 GtkWidget *pagemarks_menuitem;
82 GtkWidget *pagemarks_menu;
85 /* The tag for the idle function that sets button sensitivity. */
88 + /* encodings variable */
89 + gchar* encoding; /* the selected character set (pointer to static content -don't free it*/
90 + deConversion dcv; /* handle for character set conversion */
94 --- dillo-0.7.0~/src/dillo.c 2003-02-09 03:22:14 +0300
95 +++ dillo-0.7.0/src/dillo.c 2003-02-21 03:15:46 +0300
100 +#ifdef HAVE_LANGINFO
101 +#include <langinfo.h>
102 +#if ! defined(CODESET) && defined (_NL_CTYPE_CODESET_NAME)
103 +#define CODESET _NL_CTYPE_CODESET_NAME
107 #include <sys/types.h>
108 #include <sys/stat.h>
113 #include "bookmark.h"
114 +#include "encodings.h"
120 gint main(int argc, char *argv[])
122 - gchar *file, *curr_locale;
123 + gchar *file, *loctmp;
129 char **opt_argv = NULL;
132 - curr_locale = g_strdup(setlocale(LC_ALL, NULL));
134 /* Initialize GUI and parse GTK related args */
135 gtk_init(&argc, &argv);
141 - /* Send a delayed locale-related message */
142 - g_print("Setting locale to %s...\n", curr_locale);
143 - g_free(curr_locale);
144 + curr_locale=gtk_set_locale();
145 +#ifdef HAVE_LANGINFO
146 + curr_locale = nl_langinfo(CODESET);
148 + loctmp = strchr(curr_locale, '.');
149 + if (loctmp != NULL) {
150 + gchar** trk = g_strsplit(++loctmp, ";", 1);
151 + curr_locale = g_strdup(trk[0]);
154 + curr_locale = "ASCII";
158 + g_print("Setting locale to %s\n",curr_locale);
160 /* This lets threads in the file module end peacefully when aborted
161 * todo: implement a cleaner mechanism (in file.c) */
163 bw = a_Interface_browser_window_new(prefs.width, prefs.height, xid);
166 + a_Encodings_init();
168 /* Send dillo startup screen */
169 start_url = a_Url_new("splash", "about:", 0, 0);
170 --- dillo-0.7.0~/src/dillo.h 2002-11-28 19:42:22 +0300
171 +++ dillo-0.7.0/src/dillo.h 2003-02-21 03:15:46 +0300
177 #endif /* __DILLO_H__ */
178 diff -ubBdr -N dillo-0.7.0~/src/dillo.h.orig dillo-0.7.0/src/dillo.h.orig
179 --- dillo-0.7.0~/src/dw_style.c 2003-01-05 22:24:06 +0300
180 +++ dillo-0.7.0/src/dw_style.c 2003-02-21 03:15:45 +0300
181 @@ -245,42 +245,39 @@
182 char fontname[256], *ItalicChar;
184 ItalicChar = prefs.use_oblique ? "o" : "i";
185 - sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-iso8859-1",
186 + sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-%s",
188 font->bold ? "bold" : "medium",
189 font->italic ? ItalicChar : "r",
191 + font->size,prefs.font_charset);
192 font->font = gdk_font_load (fontname);
194 if (font->font == NULL && font->italic) {
195 - sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-iso8859-1",
196 + sprintf (fontname, "-*-%s-%s-%s-*-*-%d-*-75-75-*-*-%s",
198 font->bold ? "bold" : "medium",
199 (*ItalicChar == 'o') ? "i" : "o",
201 + font->size,prefs.font_charset);
202 font->font = gdk_font_load (fontname);
206 if (font->font == NULL) {
207 /* Can't load the font - substitute the default instead. */
210 - ("-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-iso8859-1");
211 + sprintf(fontname,"-adobe-helvetica-medium-r-normal--*-100-*-*-*-*-%s",prefs.font_charset);
212 + font->font = gdk_font_load (fontname);
215 if (font->font == NULL) {
216 /* Try another platform-font that should be available. (iPaq) */
219 - ("-misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1");
220 + sprintf(fontname,"-misc-fixed-medium-r-normal--13-120-75-75-c-80-%s",prefs.font_charset);
221 + font->font = gdk_font_load (fontname);
224 if (font->font == NULL) {
225 /* Can't load any suitable font! */
226 - g_warning ("Can't load any ISO8859-1 font!?! :(");
228 - gdk_font_load ("-adobe-helvetica-*-*-*--*-*-*-*-*-*-*-*");
229 + g_warning ("Can't load any font with charset '%s'!?! :(",prefs.font_charset);
230 + font->font = gdk_fontset_load("-adobe-helvetica-*-*-*--*-*-*-*-*-*-*-*,-misc-fixed-*,*");
234 --- dillo-0.7.0~/src/encodings.c 1970-01-01 03:00:00 +0300
235 +++ dillo-0.7.0/src/encodings.c 2003-02-21 03:15:46 +0300
239 +/* Copyright (C) 2002 Grigory Bakunov <black@asplinux.ru> */
241 +/* Copyright (C) 1997 Ian Main
243 + * This program is free software; you can redistribute it and/or modify
244 + * it under the terms of the GNU General Public License as published by
245 + * the Free Software Foundation; either version 2 of the License, or
246 + * (at your option) any later version.
248 + * This program is distributed in the hope that it will be useful,
249 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
250 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
251 + * GNU General Public License for more details.
253 + * You should have received a copy of the GNU General Public License
254 + * along with this program; if not, write to the Free Software
255 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
258 +#include <gtk/gtk.h>
267 +#include "interface.h"
270 +#include "browser.h"
275 +#define LOAD_ENCODINGS 1
276 +#define SAVE_ENCODING 2
277 +#define CLOSE_ENCODINGS 3
279 +/* this #define will cut page title if > 39 chars */
283 +#define D_QUOTE 0x22
287 +typedef struct _Encoding Encoding;
288 +typedef struct _CallbackInfo CallbackInfo;
293 + GtkWidget *menuitem;
296 +struct _CallbackInfo {
302 + * Forward declarations
305 + Encodings_load_to_menu(FILE *fp),
306 + Encodings_file_op(gint operation, const char *title, const char *iconv_name),
307 + Encodings_save_to_file(FILE *fp, const char *title, const char *iconv_name);
310 + Encodings_search_line(char *line, char *start_text, char *end_text);
312 +extern BrowserWindow **browser_window;
317 +static Encoding *encodings = NULL;
318 +static gint num_encodings = 0;
319 +static gint num_encodings_max = 16;
323 + * Allocate memory and load the encodings list
325 +void a_Encodings_init(void)
329 + /* Here we load and set the encodings */
330 + file = a_Misc_prepend_user_home(".dillo/encodings");
331 + if (access(file, R_OK))
332 + Encodings_file_op(LOAD_ENCODINGS, "/etc/dillo/encodings", NULL);
334 + Encodings_file_op(LOAD_ENCODINGS, file, NULL);
341 +void Encodings_set_encoding(GtkWidget *widget, CallbackInfo *CbInfo)
343 + if (CbInfo->index >= num_encodings) {
344 + g_warning("encoding not found!\n");
347 + g_print("Selected encoding: %s\n",encodings[CbInfo->index].iconv_name);
348 + CbInfo->bw->encoding=encodings[CbInfo->index].iconv_name;
349 + a_Nav_reload(CbInfo->bw);
350 + /*HERE!!! LOOKOUT!!!! */
354 + * Add a encoding to the encodings menu of a particular browser window
356 +void Encodings_add_to_menu(BrowserWindow *bw, GtkWidget *menuitem, guint index)
358 + CallbackInfo *CbInfo;
360 + gtk_menu_append(GTK_MENU(bw->enc_menu), menuitem);
362 + CbInfo = g_new(CallbackInfo, 1);
364 + CbInfo->index = index;
366 + /* accelerator goes here */
367 + gtk_signal_connect(GTK_OBJECT (menuitem), "activate",
368 + (GtkSignalFunc)Encodings_set_encoding, CbInfo);
374 +static GtkWidget *Encodings_insert(const char *title, const char *iconv_name)
376 + GtkWidget *menuitem;
378 + menuitem = gtk_menu_item_new_with_label(title);
379 + gtk_widget_show(menuitem);
381 + a_List_add(encodings, num_encodings, num_encodings_max);
382 + encodings[num_encodings].title = g_strdup(title);
383 + encodings[num_encodings].iconv_name = g_strdup(iconv_name);
384 + encodings[num_encodings].menuitem = menuitem;
390 + * Add the new encoding to encodings menu of _all_ browser windows and then
391 + * write the new encoding to file
394 +void a_Encodings_add(GtkWidget *widget, gpointer client_data)
396 + BrowserWindow *bw = (BrowserWindow *)client_data;
399 + gboolean allocated = FALSE;
403 + GtkWidget *menuitem;
405 + title = bw->menu_popup.info.title;
406 + iconv_name = bw->menu_popup.info.iconv_name;
409 + if (strlen (title) > 39) {
413 + memcpy (buf1, title, 18);
415 + strcpy (buf2, title + strlen (title) - 18);
417 + title = g_strconcat (buf1, "...", buf2, NULL);
422 + menuitem = Encodings_insert(title, iconv_name);
423 + Encodings_add_to_menu(browser_window[0], menuitem, num_encodings-1);
424 + for (i = 1; i < num_bw; i++) {
425 + menuitem= gtk_menu_item_new_with_label(encodings[num_encodings-1].title);
426 + gtk_widget_show(menuitem);
427 + Encodings_add_to_menu(browser_window[i], menuitem, num_encodings-1);
430 + Encodings_file_op(SAVE_ENCODING, title, iconv_name);
439 + * Never called (the file remains open all the time) --Jcid
441 +void Encodings_close(void)
443 + Encodings_file_op(CLOSE_ENCODINGS, NULL, NULL);
447 + * Performs operations on the encoding file..
448 + * for first call, title is the filename
451 + Encodings_file_op(gint operation, const char *title, const char *iconv_name)
454 + static gint initialized = 0;
456 + if (!initialized) {
457 + if (operation == LOAD_ENCODINGS) {
458 + /* SAVE_ENCODINGS is broken anyway, better make use of /etc/dillo/encodings */
459 + if ((fp = fopen(title, "r")) == NULL)
460 + g_print("dillo: opening encoding file %s: %s\n",
461 + title, strerror(errno));
465 + g_print("Error: invalid call to Encodings_file_op.\n");
468 + g_return_if_fail( initialized );
470 + switch (operation) {
471 + case LOAD_ENCODINGS:
472 + Encodings_load_to_menu(fp);
475 + case SAVE_ENCODING:
476 + Encodings_save_to_file(fp, title, iconv_name);
479 + case CLOSE_ENCODINGS:
489 + * Save encodings to ~/.dillo/encodings
492 + Encodings_save_to_file(FILE *fp, const char *title, const char* iconv_name)
494 + fseek(fp, 0L, SEEK_END);
495 + fprintf(fp, "<enc value=\"%s\">%s</a>\n", iconv_name,title);
502 +static void Encodings_load_to_menu(FILE *fp)
505 + gchar *iconv_name=NULL;
508 + GtkWidget *menuitem;
512 + g_print("Loading encodings...\n");
514 + /* Read a whole line from the file */
515 + if ((fgets(buf, 4096, fp)) == NULL)
518 + /* get url from line */
519 + if ( !(iconv_name = Encodings_search_line(buf, "=\"", "\">")) )
522 + /* get title from line */
523 + if ( !(title = Encodings_search_line(buf, "\">", "</")) ){
524 + g_free(iconv_name);
527 + printf("%s = %s\n",title,iconv_name);
528 + menuitem = Encodings_insert(title, iconv_name);
529 + Encodings_add_to_menu(browser_window[0], menuitem, i);
530 + g_free(iconv_name);
537 + * Copy encodings when new browser windows are opened.
538 + * Called by 'a_Menu_mainbar_new()'
540 +void a_Encodings_fill_new_menu(BrowserWindow *bw)
543 + GtkWidget *menuitem;
545 + for (i = 0; i < num_encodings; i++) {
546 + menuitem = gtk_menu_item_new_with_label(encodings[i].title);
547 + gtk_widget_show(menuitem);
548 + Encodings_add_to_menu(bw, menuitem, i);
553 + Encodings_search_line(char *line, char *start_text, char *end_text) {
554 + gint segment_length;
555 + char *start_index, *end_index;
557 + /* if string is not found, return NULL */
558 + if ((start_index = strstr(line, start_text)) == NULL)
560 + if ((end_index = strstr(line, end_text)) == NULL)
563 + /* adjustment cause strstr returns the start of the text */
564 + start_index += strlen(start_text);
566 + /* find length of text segment */
567 + segment_length = end_index - start_index;
568 + return g_strndup(start_index, segment_length);
571 +void a_Encoding_get_conversion(BrowserWindow *bw, char* charset) {
572 + bw->dcv.c_from=iconv_open(curr_locale,charset);
573 + bw->dcv.c_to=iconv_open(charset,curr_locale);
574 + if (bw->dcv.c_from == (iconv_t)-1 || bw->dcv.c_to == (iconv_t)-1)
575 + g_warning ("could not allocate character encoding converter.");
579 +#define MAX_CHAR_SIZE 4
580 +gchar *a_Encoding_translate_encoding(deConversion dcv, gchar *buf, gint bufsize,deDirection dir) {
581 + char *result, *source, *dest;
582 + size_t s_left, d_left;
583 + iconv_t conversion;
584 + if (dir==DE_DECODE)
585 + conversion=dcv.c_from;
587 + conversion=dcv.c_to;
588 + /* no conversion is needed, or none is available */
589 + if (conversion == (iconv_t)-1)
590 + return g_strndup(buf, bufsize);
592 + /* Note that for some conversions, the translated buffer can be larger
593 + * than the input buffer. This is particularly important for conversions
594 + * to UTF8 (check the unicode standard to find out the scale factor). */
595 + result = g_malloc((bufsize + 1)*MAX_CHAR_SIZE);
600 + d_left = bufsize*MAX_CHAR_SIZE;
601 + if (iconv(conversion, &source, &s_left, &dest, &d_left)
603 + g_warning ("unable to fully convert page to native character set");
604 + /* This just skips past unconvertable characters, putting "?" in the
605 + * output, then retries the conversion. This is a hack, but it seems
606 + * like the best course of action in the circumstances. */
607 + while (s_left > 0 && d_left > 0 && errno == EILSEQ) {
613 + if (s_left > 0 && d_left > 0)
614 + iconv(conversion, &source, &s_left, &dest, &d_left);
617 + *dest = 0; /* terminate the string */
620 --- dillo-0.7.0~/src/encodings.h 1970-01-01 03:00:00 +0300
621 +++ dillo-0.7.0/src/encodings.h 2003-02-21 03:15:46 +0300
623 +#ifndef __DILLO_ENCODING_H__
624 +#define __DILLO_ENCODING_H__
625 +#include <gtk/gtk.h>
627 +#include "browser.h"
628 +#include "encodings-types.h"
631 +/* Copyright (C) 2002 Grigory Bakunov <black@asplinux.ru> */
633 +void a_Encodings_init();
634 +void a_Encodings_add(GtkWidget *widget, gpointer client_data);
635 +void a_Encodings_fill_new_menu(BrowserWindow *bw);
636 +void a_Encoding_get_conversion(BrowserWindow *bw, char* charset);
637 +char *a_Encoding_translate_encoding(deConversion dcv, char *buf,
638 + gint bufsize,deDirection dir);
640 +#endif /* __DILLO_ENCODING_H__ */
641 diff -ubBdr -N dillo-0.7.0~/src/encodings-types.h dillo-0.7.0/src/encodings-types.h
642 --- dillo-0.7.0~/src/encodings-types.h 1970-01-01 03:00:00 +0300
643 +++ dillo-0.7.0/src/encodings-types.h 2003-02-21 03:15:46 +0300
645 +#ifndef __DILLO_ENCODING_TYPES_H__
646 +#define __DILLO_ENCODING_TYPES_H__
648 +/* Copyright (C) 2002 Grigory Bakunov <black@asplinux.ru> */
650 +typedef struct _deConversion deConversion;
652 +struct _deConversion {
663 +#endif /* __DILLO_ENCODING_TYPES_H__ */
664 diff -ubBdr -N dillo-0.7.0~/src/html.c dillo-0.7.0/src/html.c
665 --- dillo-0.7.0~/src/html.c 2003-02-14 00:01:02 +0300
666 +++ dillo-0.7.0/src/html.c 2003-02-21 03:15:46 +0300
669 #include <stdio.h> /* for sprintf */
670 #include <math.h> /* for rint */
671 +#include <errno.h> /* for iconv error codes */
676 #include "progressbar.h"
679 +#include "encodings.h"
683 @@ -2847,7 +2849,7 @@
684 if ((form->method == DILLO_HTML_METHOD_GET) ||
685 (form->method == DILLO_HTML_METHOD_POST)) {
686 GString *DataStr = g_string_sized_new(4096);
688 + GString *DataStrEnc;
689 DEBUG_MSG(3,"Html_submit_form form->action=%s\n",URL_STR_(form->action));
691 for (input_index = 0; input_index < form->num_inputs; input_index++) {
692 @@ -2911,6 +2913,12 @@
696 + DataStrEnc = g_string_new(a_Encoding_translate_encoding(html_lb->bw->dcv,
700 + g_string_free(DataStr,TRUE);
701 + DataStr = DataStrEnc;
703 if ( DataStr->str[DataStr->len - 1] == '&' )
704 g_string_truncate(DataStr, DataStr->len - 1);
705 @@ -3992,6 +4000,22 @@
706 Html_write(Client->CbData, Client->Buf, Client->BufSize, 0);
709 +static void Html_set_encoding(DilloHtml *html, char *buf, gint bufsize) {
710 + /* only do _anything_ if told so */
711 + if (html->bw->encoding != NULL)
712 + a_Encoding_get_conversion(html->bw, html->bw->encoding);
716 +static char *Html_translate_encoding(DilloHtml *html, char *buf,
718 + char* result=a_Encoding_translate_encoding(html->bw->dcv,
726 * Here's where we parse the html and put it into the page structure.
727 * Return value: number of bytes parsed
728 @@ -4147,7 +4147,11 @@
730 g_return_if_fail ( (page = DW_PAGE (html->dw)) != NULL );
732 + Html_set_encoding(html, buf, bufsize);
733 + buf = Html_translate_encoding(html, buf, bufsize);
735 token_start = Html_write_raw(html, buf, bufsize, Eof);
737 html->Start_Ofs += token_start;
740 --- dillo-0.7.0~/src/interface.c 2003-02-11 04:09:59 +0300
741 +++ dillo-0.7.0/src/interface.c 2003-02-21 03:15:46 +0300
743 #include <sys/stat.h>
744 #include <sys/time.h>
752 /* BrowserWindow holds all the widgets (and perhaps more)
753 * for each new_browser.*/
754 -static BrowserWindow **browser_window;
755 +BrowserWindow **browser_window;
756 static gint num_bw, num_bw_max;
760 bw->question_dialog_window = NULL;
761 bw->question_dialog_data = NULL;
762 bw->viewsource_window = NULL;
764 + bw->dcv.c_from = (iconv_t)-1; /* no conversion yet */
765 + bw->dcv.c_to = (iconv_t)-1;
767 /* now that the bw is made, let's customize it.. */
768 Interface_browser_window_customize(bw);
769 --- dillo-0.7.0~/src/Makefile.am 2003-01-05 22:24:06 +0300
770 +++ dillo-0.7.0/src/Makefile.am 2003-02-21 03:15:46 +0300
781 diff -ubBdr -N dillo-0.7.0~/src/Makefile.am.orig dillo-0.7.0/src/Makefile.am.orig
782 --- dillo-0.7.0~/src/menu.c 2003-02-11 00:30:13 +0300
783 +++ dillo-0.7.0/src/menu.c 2003-02-21 03:15:46 +0300
785 #include "bookmark.h"
786 #include "interface.h"
788 +#include "encodings.h"
791 * Forward declarations
793 GtkWidget *file_menu;
794 /* GtkWidget *bookmarks_menu; */
795 /* GtkWidget *help_menu; */
796 + GtkWidget *enc_menu;
798 bw->menubar = menubar = gtk_menu_bar_new();
801 Menu_add(help_menu, "Dillo _Manual", NULL, bw,
802 a_Commands_manual_callback, bw);
804 + enc_menu = Menu_new(menubar, tiny ? "_E" : "_Encodings", FALSE, bw);
805 + bw->enc_menu = enc_menu;
806 + a_Encodings_fill_new_menu(bw);
811 --- dillo-0.7.0~/src/prefs.c 2003-02-11 00:40:13 +0300
812 +++ dillo-0.7.0/src/prefs.c 2003-02-21 03:15:46 +0300
814 { "small_icons", DRC_TOKEN_SMALL_ICONS },
815 { "limit_text_width", DRC_TOKEN_LIMIT_TEXT_WIDTH },
816 { "font_factor", DRC_TOKEN_FONT_FACTOR },
817 + { "font_charset", DRC_TOKEN_FONT_CHARSET },
818 { "use_dicache", DRC_TOKEN_USE_DICACHE },
819 { "show_back", DRC_TOKEN_SHOW_BACK },
820 { "show_forw", DRC_TOKEN_SHOW_FORW },
822 case DRC_TOKEN_FONT_FACTOR:
823 prefs.font_factor = strtod(scanner->value.v_string, NULL);
825 + case DRC_TOKEN_FONT_CHARSET:
826 + if (prefs.font_charset) g_free(prefs.font_charset);
827 + prefs.font_charset = g_strdup(scanner->value.v_string);
829 case DRC_TOKEN_LIMIT_TEXT_WIDTH:
830 prefs.limit_text_width = (strcmp(scanner->value.v_string, "YES") == 0);
833 file = a_Misc_prepend_user_home(".dillo/dillorc");
834 fd = open(file, O_RDONLY);
836 - if (fd < 0 && (fd = open("/etc/dillorc", O_RDONLY)) < 0)
837 + if (fd < 0 && (fd = open("/etc/dillo/dillorc", O_RDONLY)) < 0)
838 if ((fd = open("/usr/local/etc/dillorc", O_RDONLY)) < 0)
839 return FILE_NOT_FOUND;
842 prefs.small_icons = FALSE;
843 prefs.limit_text_width = FALSE;
844 prefs.font_factor = 1.0;
845 + prefs.font_charset = g_strdup("iso8859-1");
846 prefs.use_dicache = FALSE;
847 prefs.show_back=TRUE;
848 prefs.show_forw=TRUE;
850 g_free(prefs.no_proxy);
851 if (prefs.no_proxy_vec)
852 g_strfreev(prefs.no_proxy_vec);
853 + if (prefs.font_charset)
854 + g_free (prefs.font_charset);
855 a_Url_free(prefs.http_proxy);
856 g_free(prefs.fw_fontname);
857 g_free(prefs.vw_fontname);
858 --- dillo-0.7.0~/src/prefs.h 2003-02-11 00:42:09 +0300
859 +++ dillo-0.7.0/src/prefs.h 2003-02-21 03:15:45 +0300
861 DRC_TOKEN_PANEL_SIZE,
862 DRC_TOKEN_SMALL_ICONS,
863 DRC_TOKEN_FONT_FACTOR,
864 + DRC_TOKEN_FONT_CHARSET,
865 DRC_TOKEN_SHOW_TOOLTIP,
866 DRC_TOKEN_LIMIT_TEXT_WIDTH,
867 DRC_TOKEN_USE_DICACHE,
869 gboolean small_icons;
870 gboolean limit_text_width;
872 + char *font_charset;
873 gboolean use_dicache;