GnuCash
Contact   Instructions
Bug 797880 - [gnucash-cli] encoding and font differing from manually exported reports (Win10, German locale)
Summary: [gnucash-cli] encoding and font differing from manually exported reports (Win...
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Reports (show other bugs)
Version: 4.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: reports
QA Contact: reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-30 09:09 EDT by Jannick
Modified: 2020-08-08 18:24 EDT (History)
4 users (show)

See Also:


Attachments

Description Jannick 2020-07-30 09:09:01 EDT
gnucash-4.1-2020-07-28-git-4.1-2-gef67de44d+.setup.exe (on Windows10, German locale):

A couple of gnucash-cli issues when exporting html reports on the cmd line after setting

SET LANG=de_DE
SET LANGUAGE=de_DE

to have report strings translated to German.

Issues:
1/ encoding appear to be CP1250 while reports manually exported from the GC GUI appear to be UTF-8
2/ font is Arial, while it is Segoe UI for manually exported reports.


I would expect to have identical reports which then can be consistenty processed.  Currently, the encoding issue needs post-export encoding conversion.

I hope that I am not missing something very obvious here. 

Many thanks.
J.
Comment 1 John Ralls 2020-07-30 14:34:15 EDT
The font difference is because gnucash-cli doesn't start Gtk so it can't get the default UI font from Gtk so it falls back to Arial, the hard-coded default.

The encoding problem is because we used Guile instead of C to write the output and Guile encodes the output in the CMD shell encoding.
Comment 2 Jannick 2020-07-31 04:07:39 EDT
Then a comment on encoding differences somewhere would be helpful - maybe in gnucash-cli's help screen?  It took me some time to find the encoding out for German texts.


Separately, a hint how to have gnucash-cli produce reports in a specified language in its help screen would be helpful, too.  Example for CMD:

SET LANG=de_DE
SET LANGUAGE=de_DE
Comment 3 John Ralls 2020-07-31 11:36:30 EDT
The encoding needs to be fixed, that part was a diagnostic note. Notice that the html header says that it's encoded in UTF-8, which is manifestly incorrect.

Controlling localization is the same for GnuCash and gnucash-cli and is documented in the wiki. How to actually set an environment variable is part of knowing how to use your computer and it's not GnuCash's job to teach that.

The help screen is already too verbose. The normal place for documenting Unix command-line programs is a man page, but Microsoft doesn't support that; in fact Microsoft doesn't support *any* documentation for the CMD shell. Powershell does have a nice help facility for Powershell scripts; anything else has to be served out of microsoft.com and that isn't going to happen. I think that the least-bad place for documenting gnucash-cli in the near term is the GnuCash wiki.
Comment 4 John Ralls 2020-08-08 18:24:58 EDT
I've pushed two commits to fix the encoding problem. They'll be in tomorrow's nightly and in GnuCash 4.2.

Note You need to log in before you can comment on or make changes to this bug.