This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 79323 - I18N - Schema2Beans doesn't check encoding of the xml file during writing.
Summary: I18N - Schema2Beans doesn't check encoding of the xml file during writing.
Status: RESOLVED WONTFIX
Alias: None
Product: ide
Classification: Unclassified
Component: Schema2Beans (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Erno Mononen
URL:
Keywords: I18N
Depends on:
Blocks:
 
Reported: 2006-06-28 11:47 UTC by Petr Pisl
Modified: 2007-05-26 17:33 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Pisl 2006-06-28 11:47:12 UTC
When a xml file has encoding like ISO-8859-1 and if a bean string value has
multibytes, then these multibytes are corrupted in the result xml file.  I think
that schema2beans should check the encoding of the result file and also whether
the conversion to the encoding was done correctly. Maybe the write method should
throw an encoding exception.

Usually the xml files has UTF-8 encoding and then it works ok.
Comment 1 Erno Mononen 2006-08-02 08:53:14 UTC
Will be fixed for 5.5 if time permits. Not entirely clear at this point how 
much work it will require. In any case, I can't make it throw any checked 
exceptions (too many clients to change for that), have to investigate what 
throwing a runtime exception would mean. 
Comment 2 Ken Frank 2006-08-15 18:16:31 UTC
What is the scenario for this situation from user view - want to
see what kind of impact to them and change priority perhaps to
p2 - user should be able to use characters of their language.

ken.frank@sun.com
Comment 3 Erno Mononen 2006-08-16 08:30:00 UTC
A typical scenario would be as follows:
1. have an xml file, for example web.xml 
2. change its encoding to ISO-8859-1
3, insert some non-ISO-8859-1 characters, save and close the file
4. when you open it, these characters are replaced by question marks

Basically, users may use any characters they wish as long as the encoding of 
the file is set correctly.  
Comment 4 Erno Mononen 2006-08-16 12:24:11 UTC
Thinking about this further, I don't think that this issue can be fixed in 
schema2beans - it can't be changed to throw exceptions at this point, and on 
the other hand it shouldn't be schema2beans' task to display any dialogs. I 
think this issue must be solved for each editor separately. However, it should 
be possible to fix this in xml/multiview (I'll file a new issue against it), so 
at least all editors based on it will be fixed at once.
Comment 5 Ken Frank 2007-05-26 17:33:18 UTC
I see the warning now when try to save file of this scenario - is that ok fix
for this 
as to verifying it ?

I think the problem is, that even though at runtime the non ascii characters
wont be processed/viewed ok since encoding of xml file is 8859-1,
that at least in ide, they should still show ok ?

also, Erno, you mentioned in comments below a separate issue would be filed
related to this - what is the bug id - I want to see if it needs verification
(or if not filed yet, let me know details and I can file it)

ken.frank@sun.com