[poppler] poppler/glib: poppler-document.cc,1.8,1.9

Martin Kretzschmar m_kretzschmar at gmx.net
Fri Apr 22 05:11:34 PDT 2005


Hi,

Am Dienstag, den 19.04.2005, 14:13 -0700 schrieb Jonathan Blandford:
> Index: poppler-document.cc
> ===================================================================
> RCS file: /cvs/poppler/poppler/glib/poppler-document.cc,v
> retrieving revision 1.8
> retrieving revision 1.9
> diff -u -d -r1.8 -r1.9
> --- poppler-document.cc	16 Apr 2005 18:57:44 -0000	1.8
> +++ poppler-document.cc	19 Apr 2005 21:13:22 -0000	1.9
> @@ -293,7 +293,7 @@
>  	info_dict_get_string (obj.getDict(), "Title", value);
>        break;
>      case PROP_FORMAT:
> -      str = g_strdup_printf ("PDF-%1f", document->doc->getPDFVersion ());
> +      str = g_strdup_printf ("PDF-%1g", document->doc->getPDFVersion ());

IMHO it should use a locale-independent formatting.

(Another explanation: e.g. in Germany, the decimal separator is ",", but
version numbers are still "."-separated. Are there locales where version
numbers don't use "."?)

Attached patch changes that code to use g_ascii_formatd.

OTOH this is pretty academic. Somehow poppler_document_new_from_file
clobbers the LC_NUMERIC settings. If you want to test this patch, put
your setlocale (LC_ALL, ""); call immediately before print_document_info
in test-poppler-glib.c (and include locale.h).

>        g_value_take_string (value, str);
>        break;
>      case PROP_AUTHOR:

Regards,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ascii-formatd.diff
Type: text/x-patch
Size: 1436 bytes
Desc: 
Url : http://lists.freedesktop.org/archives/poppler/attachments/20050422/0ab2c0de/ascii-formatd.bin


More information about the poppler mailing list