Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Charset and Custom Item
kosta
Hello BIRT community,
I have created custom item that prints German Text. In the developer enviroment it works fine. The UTF-8 text is shown like it should be. The custom item is used in a rptdesign file.
When the item is exported as plug-in it is used in a rptlibrary. The grid with the item is added programmaticaly to one "ReportDesignHandle"-object. The text is shown as ISO 8859-1 so the german signs can't be read. I saw that the ReportDesignHandle.CHARSET is set to 8859_1 because it comes from the "IInternalReportDesignModel" iterface.
Is there any way to set the CHARSET of the "ReportDesignHandle" to UTF-8. I couldn't find any methods for that.
And how is that working in the development enviroment, but not when is exported as plug-in.
For any suggestions and hints thanks in advance.
Find more posts tagged with
Comments
kosta
I have modified the rotated text example 2.<br />
<br />
There ist the same problem.<br />
<br />
To modifiy it you need to change the "RotatedTextPresentationImpl"-class. Before the "BufferedImage" is created put something like:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
text = text + " ???????";
</pre>
<br />
After exporting this (copy it to the plugin folder) and using it into a report u can see that this text from the source file is always presented as ISO 8859-1 but the source file itself is coded in UTF-8. (Character encoding utf-8).
kosta
For now I found some workaround.<br />
<br />
I am not printing thouse chars as charset depended signs but as unicode sybols.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
//u umalut
public static final char U_DIERESIS_SMALL = '\u00fc';
public static final char U_DIERESIS_BIG = '\u00dc';
//a umlaut
public static final char A_DIERESIS_SMALL = '\u00e4';
public static final char A_DIERESIS_BIG = '\u00c4';
//o umlaut
public static final char O_DIERESIS_SMALL = '\u00f6';
public static final char O_DIERESIS_BIG = '\u00d6';
//eszett
public static final char S_SHARP = '\u00df';
</pre>
<br />
<br />
This workaround is only good if the chars are mapping to ISO 8859-1.<br />
What if I want to print chinese letters. Then this solution will not fit.<br />
<br />
It should be possible to print any kind of unicode chars into the custom items.
JasonW
Kosta,
Can you open a bugzilla entry for this?
Jason