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.
Product Version: NetBeans IDE Dev (Build 070612) Java: 1.6.0_02-ea; Java HotSpot(TM) Client VM 1.6.0_02-ea-b02 System: Linux version 2.6.20-15-generic running on i386; UTF-8; en_US (nb) In web application project properties, you can specify encoding. For example set ISO-8859-2. web.xml is generated with <?xml version="1.0" encoding="UTF-8"?> so file is utf-8. To make it ISO-8859-2, you have to set it manually <?xml version="1.0" encoding="ISO-8859-2"?> Btw <?xml version="1.0"?> == <?xml version="1.0" encoding="UTF-8"?>. Because UTF-8 is default encoding in xml files
see issues 97871, 107910 - the project encoding setting/handling is not compleltely implemented. and for solving this issue, the jsp file nencidng tag will be seeded with that of the project encoding; and when changing the project encoding, the next jsp file will be seeded with that encoding tag. ken.frank@sun.com
now that there has been more implemenation of project and file encoding, and that jsp, html and many xml files set their encoding prop from the project encoding, can this issue be fixed for nb6 ? ken.frank@sun.com
Will fix for 6.0 if time permits. The same applies for ejb-jar.xml and persistence.xml as well.
2 questions on this if user not change web.xml, ejb-jar, persistence.xml encoding, will the project encoding still be used as part of creation and processing of these files (for nb6 projects ?) That is, if user has project using some encoding other than default of utf-8, uses the provided ui editors for these files (vs hand edit) - will the characters user adds to these files be processed and shown ok ? that is, since encoding of these files are utf-8, will it handle chars from any other encoding ? if not that could be a problem that might need fixing for nb6. (and for other web and j2ee kind of config/control files in a nb project) 2. case of user changing the encoding of the generated files by hand - we can't really control that and I don't think that is what this issue is about, except that user might need to do it to workarond that utf-8 is used. ===> main thing IMO at this late date is not to destabilize things while still being in sync with feq implementations. if using utf-8 will cover all cases even though project encoding is different then perhaps it can stay, but if not seems like a problem. ken.frank@sun.com
Could someone please post a (realistic) use case where using utf-8 as encoding for the files in question, even when the project encoding is set to something else, would be a problem? I can't think of any now and would rather not take the risk of introducing new bugs at this stage without a strong argument to do otherwise. Thanks in advance.
I agree that its late in cycle and we don't want to destabilize. Radim, can you look at this again and see if its ok for use cases where users use project properties and create files that are seeded with project encoding. or is it that if user changes project props, that the value of the encoding in the file you mention is NOT changed ? ken.frank@sun.com
So we agree on not fixing this for 6.0? I'm removing fix-in-60 then and downgrading this to P4 as I can't see this having much user impact. If you disagree, please raise the priority with a use case demonstrating the impact. Thanks.
OK..I've tested it again.. just for info ( java files are working without flaw :) html files created correctly - according to project props => e.g. ...content="text/html; charset=ISO-8859-2"> when encoding is changed in project back to utf8 in project, file remains iso 8859-2..that is ok, if tag in html is changed to utf-8..file is changed to utf8 and correctly displayed ( in nb and also in firefox ) new xml files - same as with html files persistence.xml, web.xml ,ejb-jar.xml - always created in utf8 That means its OK.
ehm..there was a collision so i change...as you did...sorry for that ;)
is there still a part of this that is an issue or problem ? I just want to be clear on it and also to know if its something that should be added to docs (there is new inprogress olh topics on project and file encoding) ken.frank@sun.com
well...as i said..i think its ok.. maybe in doc there can be written important configuration files are made in utf-8. But i cannot see any reason why this would be a problem...if there is not programmer that would name his classes in Japanese :)...
Radim, 121004 has some fixes that might relate to parts of this also. it seemed that for some config/control kind of xml based files, like build.xml, web.xml. etc, which still use utf8 encoding tag, and not tag for the project encoding, that if project encoding was not utf8, and if non ascii was added (even as a legal comment), then the file was being read/written using utf-8, which meant compiling errors. the fix, I think, is to consult the project encoding in these cases. I am now trying to go thru projects using non utf8 encoding and adding some non ascii multibyte to these kind of files, even if its just some comment line, to see that its ok. ken.frank@sun.com
Radim, based on your comments, I think this is now ok, except that we assume that user might name classes or vars with non ascii characters - its legal to do so in java and nb has always supported that in java editor, for example. -- thus could this be a problem in that context ? ken.frank@sun.com
Hi, i've tried to play with encoding and using non-ascii chars....i think it works in NB fine now..files are created in p roject encoding..except these xml configuration files that are always in utf. But because classes with non-ascii chars are correctly in source file and in unicode configuration file as well..it is not a problem even in this context..
Looks like this issue can be closed. Ken, please re open if this is still an issue.