r15795 - gnucash/trunk/lib/libqof/qof - Improve printing of dates and times with non-UTF-8 locales and on Windows.

Andreas Köhler andi5 at cvs.gnucash.org
Wed Apr 4 14:48:45 EDT 2007


Author: andi5
Date: 2007-04-04 14:48:42 -0400 (Wed, 04 Apr 2007)
New Revision: 15795
Trac: http://svn.gnucash.org/trac/changeset/15795

Added:
   gnucash/trunk/lib/libqof/qof/gnc-date-p.h
   gnucash/trunk/lib/libqof/qof/qof-win32.c
Modified:
   gnucash/trunk/lib/libqof/qof/Makefile.am
   gnucash/trunk/lib/libqof/qof/gnc-date.c
   gnucash/trunk/lib/libqof/qof/gnc-date.h
Log:
Improve printing of dates and times with non-UTF-8 locales and on Windows.

* qof_time_format_from_utf8 converts an strftime format specification
  from UTF-8 to the locale encoding
* qof_format_time calls strftime repeatedly with growing allocated
  buffers until the result fits into one, or return NULL
* qof_formatted_time_to_utf8 converts the result back to UTF-8
* qof_strftime takes similar arguments to strftime, but in UTF-8
* the conversion functions on Windows are implemented in qof-win32.c to
  allow them to use windows.h, as they need wcstombs and mbstowcs




More information about the gnucash-patches mailing list