non-latin 1 reports

Derek Atkins warlord at MIT.EDU
Fri Feb 13 09:18:16 CST 2004


Hi,

First, your mailer completely screwed up the patch by line-wrapping
it.  In the future, please send patches as an attachment instead of
inlining them.

Second, patches should go to gnucash-devel or gnucash-patches.

Third, gnucash doesn't do UTF-8 yet.  The internationalization is
really, umm, under-worked at this point.  I find it surprising
that just telling gtkhtml that you're using utf8 will solve the
problem portably, especially since gnome-1.4 doesn't handle utf8
properly itself.  So I'm a bit hesitant to apply this patch to
1.8.

The gnome2 branch should actually fix it, because everything will be
utf8.

-derek

zellerin at volny.cz writes:

> Hello,
>
> I was trying to make GnuCash produce reports in latin-2
> characters. I was able to do so after patching gnc-html.c and
> setting locales to UTF-8 (cs_CZ.UTF-8, that is), but I am not
> sure this is the right way.
>
> Questions:
> - am I reinventing wheel and should I RTFM (I did try, as well as
> Googled, so please point specifically) - if not, I have two
> problems. Is it possible to make gnucash perform the conversion
> latin-2->utf-8 when locales left to default cs_CZ? Is it possible
> to specify how thousand separators should look like, other than
> LC_MONETARY? It is the last thing that looks ugly on reports.
>
> I use Gnucash 1.8.7, but nothing like this appeared in changelog
> to 1.8.8.
>
> Regards,
> Tomas Z.
>
> P.S.: Yes, I know about gnucash-devel list. I still hope it is
> only question on usage :-) The patch is here only to prevent "it
> is impossible" I think I saw somewhere. I do not suggest direct
> including it. Should the discussion be moved to -devel, please cc
> me, I am not there.
>
> --------------------------
> Patch itself (hope my web-based mailer wont botch it; if it does,
> it can be found at http://www.volny.cz/zellerin/gnucash/ and is
> simple enough to redo).
>
> --- gnucash-1.8.7/src/gnome-utils/gnc-html.c	Sat Apr 12 19:03:30
> 2003 +++ gnucash-1.8.7/src/gnome-utils/gnc-html.c	Wed Feb 11
> 19:29:05 2004 @@ -57,6 +57,12 @@
>  #include "gnc-ui-util.h"
>  #include "messages.h"
>  
> +/*
> + * Larry Ewing in gtkhtml mailing list, June 2001: <q>Now this
> might look like + * GtkHTML would be smart if you passed it some
> other content type (...) but it + * won't right now, so don't
> try</q>
> + */
> +static char contenttype[]="text/html; charset=utf-8"; /* const
> not allowed */  
>  struct gnc_html_struct {
>    GtkWidget   * container;         /* parent of the gtkhtml
> widget */ @@ -458,7 +464,7 @@
>    /* handles will be NULL for an HTTP POST transaction, where we
> are     * displaying the reply data. */
>    if(!handles) {    
> -    GtkHTMLStream * handle =
> gtk_html_begin(GTK_HTML(html->html)); +    GtkHTMLStream * handle
> = gtk_html_begin_content(GTK_HTML(html->html), contenttype);     
> if(completed_ok) {
>        gtk_html_write(GTK_HTML(html->html), handle, body,
> body_len);      }
> @@ -974,7 +980,7 @@
>    GtkHTMLStream * handle;
>  
>    DEBUG("datalen %d, data %20.20s", datalen, data);
> -  handle = gtk_html_begin(GTK_HTML(html->html));
> +  handle = gtk_html_begin_content(GTK_HTML(html->html),
> contenttype);    gtk_html_write(GTK_HTML(html->html), handle,
> data, datalen);
>    gtk_html_end(GTK_HTML(html->html), handle,
> GTK_HTML_STREAM_OK);    }
> @@ -1068,7 +1074,7 @@
>  	    g_strdup (extract_base_name(result.base_type,
> new_location));        DEBUG("resetting base location to %s", 
> html->base_location);      
> -      stream = gtk_html_begin (GTK_HTML(html->html));
> +      stream = gtk_html_begin_content(GTK_HTML(html->html),
> contenttype);        gnc_html_load_to_stream (html, stream,
> result.url_type,
>                                 new_location, new_label);
>  
> @@ -1123,7 +1129,7 @@
>        /* FIXME : handle new_window = 1 */
>        gnc_html_history_append(html->history,
>  			      gnc_html_history_node_new(type, location, label));
> -      handle = gtk_html_begin(GTK_HTML(html->html));
> +      handle = gtk_html_begin_content(GTK_HTML(html->html),
> contenttype);        gnc_html_load_to_stream(html, handle, type,
> location, label);  
>      } while (FALSE);
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at lists.gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>
>

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list