[Kmymoney-devel] KMyMoney: proposal to replace hard coded utf-8 in KReportsView::KReportTab

Alvaro Soliverez asoliverez at gmail.com
Sat Mar 27 01:29:45 CET 2010


Hello Bernd,
I applied the encoding fix.
However, the rest of the patch seems to need more work, because it
doesn't work here.
We are close to the release of our upcoming beta, so you can work on
it a little longer and we'll include it in the next release if it
passes review.

Thanks for your contributions!

Regards,
Alvaro

On Wed, Mar 24, 2010 at 4:02 PM, Bernd Gonsior <bgo at freeplexx.de> wrote:
> Dear Mr. Soliverez,
>
> thank you for developing KMyMoney. It is really great and i do use it for my
> daily work.
>
> Unfortunately i am a german who intentionally uses latin1 instead of utf-8
> which always made some trouble when creating reports with KMyMoney because
> german umlauts did not appear correct.
>
> The reason is that 'utf-8' is 2 times hardcoded in KReportsView::KReportTab.
> One can find it in svn revision r1106729 here:
>
> 1. KReportsView::KReportTab::saveAs, line 147:
>
>  QRegExp exp("(.*)(<link.*css\" href=)\"(.*)\">(<meta.*utf-8\" />)(.*)");
>
> (this regexp was used to split the just generated html so that css could be
> included inline, but if the encoding was not 'utf-8' but instead e.g. 'latin1'
> this regexp took ages)
>
> 2. KReportsView::KReportTab::createTable, line 234:
>
>  header += "<meta http-equiv=\"Content-Type\" content=\"text/html;
> charset=utf-8\" />";
>
>
> Proposal:
>
> KGlobal::locale()->encoding() should be used instead of hard coded 'utf-8'.
>
> Furthermore the above mentioned regexp for including css inline could be
> replaced by more clearly declared methods.
>
> I appended the svn-diffs and the new files to this mail. If you find it
> useful, maybe you can include it in any way you like. The main things are
> outlined in kreportsview.h.
>
> With best regards
>
> Dipl.-Ing. Bernd Gonsior
> Dolgenseestrasse 43
> 10319 berlin
> Germany
>
> phone: +49-30-20 23 89 98
> email: bgo at freeplexx.de
>


More information about the KMyMoney-devel mailing list