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)
Tracking
()
RESOLVED
DUPLICATE
of bug 287682
People
(Reporter: pierre, Unassigned)
Details
Attachments
(2 files, 1 obsolete file)
25.23 KB,
image/png
|
Details | |
1.07 KB,
patch
|
LpSolit
:
review-
|
Details | Diff | Splinter Review |
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)
Reporter | ||
Updated•12 years ago
|
OS: All → Linux
Hardware: All → x86_64
Reporter | ||
Comment 1•12 years ago
|
||
For information, I still got the issue on Bugzilla 4.2.5
Updated•12 years ago
|
Summary: Graphical reporting encoding issue on png image → Graphical report: Wrong encoding on png image for non-ascii letter é
Reporter | ||
Comment 2•12 years ago
|
||
Hi Andre,
Sorry but the issue is not only on 'é', but on all chars with accents (à,é,ï,ç....)
Comment 3•12 years ago
|
||
I think you need to install suitable font to the system. (if I correctly remembers)
Reporter | ||
Comment 4•12 years ago
|
||
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);
}
Comment 5•12 years ago
|
||
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
Comment 6•11 years ago
|
||
Hi, what about a litle hack
Comment 7•11 years ago
|
||
(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?
Comment 8•11 years ago
|
||
Hi, I made a fix, I post it in attachment.
Comment 9•11 years ago
|
||
Comment 10•11 years ago
|
||
Complete fix for graph font
Attachment #776450 -
Attachment is obsolete: true
Comment 11•11 years ago
|
||
This is the complete fix for all fields of the graph.
Comment 12•11 years ago
|
||
(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 13•11 years ago
|
||
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-
Comment 14•9 years ago
|
||
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.
Description
•