Closed Bug 863222 Opened 12 years ago Closed 9 years ago

Graphical report: Wrong encoding on png image for non-ascii letters

Categories

(Bugzilla :: Reporting/Charting, defect)

4.0.10
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 287682

People

(Reporter: pierre, Unassigned)

Details

Attachments

(2 files, 1 obsolete file)

Attached image graph_gravite.png (deleted) —
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0 Build ID: 20130326150557 Steps to reproduce: When I want to process a reporting and generate a chart with severity (x field) for example, the generated graph is ok in English. But if I generate it in another language (French in my case), there is an encoding issue. Actual results: The "é" chars for example doesn't show properly but in the web interface it's OK. It looks like the field is not properly encoded before being send to GD library. Expected results: For example, the Severity field in french is called "Severité", but the last char 'é', doesn't looks like how it should (image attached)
OS: All → Linux
Hardware: All → x86_64
For information, I still got the issue on Bugzilla 4.2.5
Summary: Graphical reporting encoding issue on png image → Graphical report: Wrong encoding on png image for non-ascii letter é
Hi Andre, Sorry but the issue is not only on 'é', but on all chars with accents (à,é,ï,ç....)
I think you need to install suitable font to the system. (if I correctly remembers)
No I don't. This test works well on the same machine : #!/usr/bin/env perl use strict; use GD::Graph::bars; use GD::Graph::hbars; use GD::Graph::Data; use utf8; use Encode; require 'save.pl'; my $data = GD::Graph::Data->new([ ["1st","2nd","3rd","4th","5th","6th","7th", "8th", "9th"], [ 1, 2, 5, 6, 3, 1.5, 1, 3, 4], ]) or die GD::Graph::Data->error; my @names = qw/sample11 sample11-h/; for my $my_graph (GD::Graph::bars->new, GD::Graph::hbars->new) { my $name = shift @names; print STDERR "Processing $name\n"; my $test_accent = encode('latin1', 'ééé'); $my_graph->set( x_label => 'X Label', y_label => $test_accent, title => 'A Simple Bar Chart', #y_max_value => 8, #y_tick_number => 8, #y_label_skip => 2, #x_labels_vertical => 1, # shadows bar_spacing => 8, shadow_depth => 4, shadowclr => 'dred', transparent => 0, ) or warn $my_graph->error; $my_graph->plot($data) or die $my_graph->error; save_chart($my_graph, $name); }
Confirmed.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86_64 → All
Summary: Graphical report: Wrong encoding on png image for non-ascii letter é → Graphical report: Wrong encoding on png image for non-ascii letters
Hi, what about a litle hack
(In reply to Sandro Cazzaniga from comment #6) > Hi, what about a litle hack oops, not finished... so a little hack, maybe a function in report.cgi to replace hexadecimal characters of a string?
Hi, I made a fix, I post it in attachment.
Attached patch Patch by Kharec (obsolete) (deleted) — Splinter Review
Complete fix for graph font
Attachment #776450 - Attachment is obsolete: true
This is the complete fix for all fields of the graph.
(In reply to Sandro Cazzaniga from comment #11) > This is the complete fix for all fields of the graph. This is totally not a fix, since you added configurations of font file itself into core code. I believe we have already discussed (and have an issue within bmo), this is really difficult i18n issue, since we need to deal with system's font handling.
Comment on attachment 777664 [details] [diff] [review] bugzilla-fix-fonts-in-graph-bars_v2.patch As himorin said, we cannot accept this patch as it's really platform-specific. You would need e.g. a new parameter for the admin to type the path to the font.
Attachment #777664 - Flags: review-
Fixed in 5.0.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: