[#1056] - JRXML encoding not UTF-8 compliant

Category:
Bug report
Priority:
Urgent
Status:
Assigned
Project: Severity:
Critical
Resolution:
Open
Component: Reproducibility:
Always
Assigned to:

In iReport the two optiosn for encoding of an xml file are UTF-8 or IS0-8859-1. The issue arises when you use the pattern "wizzard" for text field boxes. When you use the pattern for currency, a specfic character is used as the marker for the currency symbol '¤'. This character is handled by the code, throuth the Xerces Dom parser. When trying to load the jrxml file, with this character in it, through the org.xml.sax parser, it throws an exception stating that the character is not a valid UTF-8 character. The locale seems to have no effect, nor the encoding, because when the xml file, that contains the erring character, is forced to be utf-8, the character breaks, and is changed into another, showing that it is not a valid UTF-8 character. An image is attached showing the invalid currency character coming up in the latest version of iReport.

AttachmentSize
Image icon currencyIssue.jpg19.54 KB
SavedLinuXgeeK's picture
Joined: Aug 14 2006 - 9:30pm
Last seen: 10 years 1 month ago

6 Comments:

#1

The character is in FieldPatternDialog.java, at line 936 in the 1.2.5 release. The character is "\\u00A4". I know this is not valid utf-8, as it gets changed, but I don\'t know what encoding it is.

#2

Well it is infact the currency symbo, which is used by formatting code in java to convert it to a local currency symbol (the "\\u00A4") that is. The only problem is the symbo is not valid when parsing the xml file as a strict utf-8 file. Don\'t know what to do about it from here.

#3

The character in question is unicode 00A4, ant the UTF-8 encoding should be 0xC2A4. If it gets written out as 00A4 that IS wrong, as it isn\'t being encoded to UTF-8 correctly.

#4

I am pretty sure it is saving it as 00A4, because I do a find replace on the xml string (I am trying to parse the xml file w/ a sax parser), and replace \'00A4\' with \'\' and it works.

#5

I am using Win32 as the platform (XP). I wasn\'t able to have the
currency character that JasperReports uses, save in a utf-8 text editor
as well. But UTF-8 should be platform independant, so I do not know.

#6

Hi Giulio,

I\'ve got a board meeting most of today, so I\'ll run this test again later
and send you the JRXML if I still see the problem.

-Barry

On 11/15/06 2:46 AM, "JasperForge Administrator" <admin@jasperforge.org>
wrote:

>
artf1525: JRXML encoding not UTF-8 compliant

Modified on 11/15/2006 by
> Giulio Toffoli
Assigned To: - New: "Giulio Toffoli" Old: "No user"

Comment
> was added:
On my system it works and no exception is thrown.
>
> What OS are you using?
>
> Giulio

Respond by
> visiting:
http://www.jasperforge.org/sf/go/artf1525

-------------------------
> --------------------------------------------
Artifact details:-

Project:
> iReport
Tracker: Bugs

Group:
Status: Open
Category:
Customer:
Priority:
> 2
Assigned To: Giulio Toffoli
Reported in release: none
Fixed in release:
> none
Estimated Hours: 0
Actual Hours: 0

Description: In iReport the two
> optiosn for encoding of an xml file are UTF-8 or IS0-8859-1. The issue arises
> when you use the pattern "wizzard" for text field boxes. When you use the
> pattern for currency, a specfic character is used as the marker for the
> currency symbol \'¤\'. This character is handled by the code, throuth the
> Xerces Dom parser. When trying to load the jrxml file, with this character in
> it, through the org.xml.sax parser, it throws an exception stating that the
> character is not a valid UTF-8 character. The locale seems to have no effect,
> nor the encoding, because when the xml file, that contains the erring
> character, is forced to be utf-8, the character breaks, and is changed into
> another, showing that it is not a valid UTF-8 character. An image is
> attached showing the invalid currency character coming up in the latest
> version of iReport.

Feedback
randomness