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 107911

Summary: I18N - encoding of created xml files needs to be based on project encoding
Product: xml Reporter: Ken Frank <kfrank>
Component: CodeAssignee: Samaresh Panda <samaresh>
Status: RESOLVED DUPLICATE    
Severity: blocker Keywords: I18N
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Ken Frank 2007-06-23 01:36:06 UTC
now there is new project and file encoding implementation and issue 97872 is filed about it.

Related to this is that currently,
new jsp files  are seeded with utf-8 encoding tag when the files are created.

however, feq implemenation is for encoding of new projects are seeded with current value of global encoding
or use utf-8 by default.

from mail discussions with Tomas, the xml file needs to get its encoding from the project
encoding value, and also its better to place that encoding in the charset notation
of the xml file.

(similar issues are filed on html and jsp files)

(information from Tomas is that the encoding of the html or jsp or xml
file is the one used in the editor and other non runtime operations
of these files - besides being for the runtime information.)
Comment 1 Ken Frank 2007-06-23 01:37:26 UTC
also, the other parts of the project need to use the project encoding in their interaction
with the xml file as to non runtime aspects like in the editor, etc.

ken.frank@sun.com
Comment 2 Ken Frank 2007-07-01 19:17:09 UTC
I think this would apply to all xml files that are created by or for user that are 
listed in the template manager ? 

 or should some stay using the utf-8 that is hardcoded now ?
(perhaps there are others also ?)

I don't know if this issue should be done until 97872 related to project encoding handling would be done ?

ken.frank@sun.com
Comment 3 Ken Frank 2007-08-14 16:15:51 UTC
now this has been done for jsp and html files; and developer in other area was asking about this
one and 97872 related to issues in their areas (that is, they need to fix some encoding problems
but approach might be different once these are implemented.

ken.frank@sun.com
Comment 4 Nikita Krjukov 2007-08-16 13:05:47 UTC
I'm not sure it worth to allow to a user creating an XML with 
non-standard encoding other then UTF-8. The user can accidently
specify a non UTF-8 encoding for the project and forget about it. 
He can note too late that all his XML files are created in a 
non-standard encoding.

But if Ken is insisting on it, then I suppose the encoding 
can be specified here: 

package org.netbeans.modules.xml.core;
class XMLDataLoader
method: createFromTemplate
   BufferedWriter w = new BufferedWriter (new OutputStreamWriter (fo.getOutputStream (lock), "UTF8")); // NOI18N

Also the encoding value has to be parametrized in all XML templates. 
I hope we have not so much of them now.
Comment 5 Samaresh Panda 2007-08-16 23:42:35 UTC
Point taken, we need to have FEQ, but we don't have to have several issues for the same thing.

*** This issue has been marked as a duplicate of 97872 ***