Home
Analytics
Please Help - HTML Rendering - Problem with Special Characters
qos
Hello,
We have just finished upgrading our application from Birt 2.2 to Birt 2.6.1. Since then, the output to html does not render latin characters correctly, to pdf everything is fine.
Is there any new configuration that we should be looking to?
Searching this problem i found out that someone else has it but had no reply yet
(
http://www.birt-exchange.org/org/forum/index.php/topic/20944-html-character-entities-not-displaying-correctly/page__s__e02e635e20673c392e43d8f30f113653
)
Thanks in advance
Find more posts tagged with
Comments
JasonW
Can you open a bug for this?
Do you have a sample report I could test with?
Jason
qos
Hello Jason,
I now have reason to believe that the problem is that BIRT always outputs UTF-8 encoded HTML even if the default platform encoding is set to ISO-8859-1.
My client application has an embedded browser and must run with encoding ISO-8859-1, so if I open an UTF-8 encoded HTML file I get the problem stated above.
I guess that the problem doesn't happen with PDF files because the output is binary and encoding agnostic.
So I guess my question boils down to the following: how could I dinamically generate a report design and run it to produce an ISO-8859-1 encoded HTML file?
Is there any configuration options available to do this? I've failed to find it...
Thank you for your help!
PS: Not opening a bug report just yet because this might be by design...
JasonW
Are you using the viewer or the RE API?
If so maybe you can set the content to embeddable which drops the headers etc and create your own html page to include it with. No sure if this will work but may be worth a try.
HTMLRenderOption options = new HTMLRenderOption();
options.setOutputFileName("output/resample/teest.html");
options.setOutputFormat("HTML");
options.setEmbeddable(true);
Jason
qos
Hi Jason,
I'm using the RE API and passing the ServletOutputStream to setOuputStream().
Invoking the servlet is my very own SWT application with is bound to use ISO-8859-1 as default encoding.
I had already tried setEmbeddable(true) but it didn't work.
So far I've circumvented the problem by reading the servlet response as an UTF-8 string, instead of a generic array of bytes (which I can do in this particular case).
My immediate problem is therefore solved, but shouldn't BIRT be able to output html in whichever encoding the user sees fit?
Yunmanger
Hi!
I am facing the same problem. Is there any updates on this issue?
JasonW
I do not think a bug was ever opened for this.
Jason
Yunmanger
<blockquote class='ipsBlockquote' data-author="'JasonW'" data-cid="84147" data-time="1318612499" data-date="14 October 2011 - 10:14 AM"><p>
I do not think a bug was ever opened for this.<br />
<br />
Jason<br /></p></blockquote>
<br />
<a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=361090'>https://bugs.eclipse.org/bugs/show_bug.cgi?id=361090</a>
;
mas_h
Hi,
May I know whether this is already resolved in 3.7.1?
I'm having similar problem.
lonhro
Hello<br />
<br />
I have an issue which seems to be similiar to the one stated above, it is definitely related to character set. The problem is with the ? symbol which is displayed as £ when viewed in HTML.<br />
<br />
<ul class='bbc'><li>This affects HTML reports when view in IE and Chrome</li><li>It does not affect HTML reports when viewed in Firefox</li><li>For IE/Chrome if you change the encoding on the browser from Auto-Select to Unicode (UTF-8) then it renders correctly, but this is not a viable work-around.</li></ul>
<br />
I am sure there must be a work-around for displaying the ? symbol. Any advice appreciated.<br />
<br />
Thanks
mas_h
Hi lonrho,
Try setting to "UTF-8" when sending the output stream to the request object.
For example, with a ByteArrayOutputStream called baos, call baos.toString("UTF-8")
before sending it as a session object (In my case i keep it as a session obj).