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 97850 - Provide FileEncodingQueryImplementation.
Summary: Provide FileEncodingQueryImplementation.
Status: VERIFIED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: J Bachorik
URL:
Keywords: I18N
Depends on:
Blocks: 97848 103895
  Show dependency tree
 
Reported: 2007-03-14 16:01 UTC by Tomas Zezula
Modified: 2007-07-07 18:36 UTC (History)
3 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 Tomas Zezula 2007-03-14 16:01:38 UTC
The project type should provide FileEncodingQueryImplementation in its loookup.
The javac task should use encoding argument.
Comment 1 J Bachorik 2007-05-30 09:21:16 UTC
implemented all necessary parts

Checking in ui/customizer/WebProjectProperties.java;
/cvs/web/project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java,v
 <--  WebProjectProperties.java
new revision: 1.105; previous revision: 1.104
done
Checking in ui/customizer/Bundle.properties;
/cvs/web/project/src/org/netbeans/modules/web/project/ui/customizer/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.80; previous revision: 1.79
done
Checking in ui/customizer/CustomizerSources.form;
/cvs/web/project/src/org/netbeans/modules/web/project/ui/customizer/CustomizerSources.form,v
 <--  CustomizerSources.form
new revision: 1.5; previous revision: 1.4
done
Checking in ui/customizer/CustomizerSources.java;
/cvs/web/project/src/org/netbeans/modules/web/project/ui/customizer/CustomizerSources.java,v
 <--  CustomizerSources.java
new revision: 1.12; previous revision: 1.11
done
Checking in WebProject.java;
/cvs/web/project/src/org/netbeans/modules/web/project/WebProject.java,v  <-- 
WebProject.java
new revision: 1.124; previous revision: 1.123
done
Checking in api/WebProjectUtilities.java;
/cvs/web/project/src/org/netbeans/modules/web/project/api/WebProjectUtilities.java,v
 <--  WebProjectUtilities.java
new revision: 1.17; previous revision: 1.16
done
Checking in resources/build-impl.xsl;
/cvs/web/project/src/org/netbeans/modules/web/project/resources/build-impl.xsl,v
 <--  build-impl.xsl
new revision: 1.136; previous revision: 1.135
done
RCS file:
/cvs/web/project/src/org/netbeans/modules/web/project/queries/WebProjectEncodingQueryImpl.java,v
done
Checking in queries/WebProjectEncodingQueryImpl.java;
/cvs/web/project/src/org/netbeans/modules/web/project/queries/WebProjectEncodingQueryImpl.java,v
 <--  WebProjectEncodingQueryImpl.java
initial revision: 1.1
done
Comment 2 Ken Frank 2007-06-18 21:19:45 UTC
reopening this this web project does not seem to read or write the global encoding set from project properties

1. create new j2se project (j2se project known to read/write global encoding value ok

2.  change the encoding value to something else.

3. create new web project

4. look at the encoding property - its not the one changed in step 2.

5. change the encoding value of the web project

6. create new web or j2se project

7. the new project encoding property is not the one changed in step 5.


PS - besides testing this fix out first before resolving it, please review the code also for the following situations:

a. that the project encoding will be used for compilation 

b. that when it does change the encoding, that new files created in the project use the new encoding
(besides html, jsp and xml - see c. below

c. as per spec/infoTomas provided, and as part of other tasks, 97871 and 97873
the charset tag, if present, in jsp and html files will be used for the
encoding versus that of the project encoding -- please make sure these
2 senses of encoding work together in the project.

d. We are assuming that for java and other non html and jsp files,
that the project encoding will be used ?


e. Also, please note that visualweb has not yet implemented the feq
as part of 10078 - will this have any impact on encoding handling
for web projects that use vwp framework (once this issue is fixed ?)

ken.frank@sun.com
Comment 3 J Bachorik 2007-06-25 15:45:20 UTC
Changing file encoding for the web project changes the global file encoding as well

Checking in WebProjectProperties.java;
/cvs/web/project/src/org/netbeans/modules/web/project/ui/customizer/WebProjectProperties.java,v  <-- 
WebProjectProperties.java
new revision: 1.107; previous revision: 1.106
Comment 4 Ken Frank 2007-06-27 23:38:10 UTC
Yardus,

does all this work now together as to web apps project encoding property read and write  and jsp file encodings as per
97871 and 107919, which are now resolved ?

but in  97871 I dont think should open files using utf-8 but using the global file encoding value ?

it says in 97871
The fix probably caused that a warning dialog appears when you create a web
project and it opens index.jsp file. Message is: 

The "ISO-8559-1" character set that is used in index.jsp is not a valid
character set for JSP Pages. Do you want to open the file using the UTF-8
character set?

---> but isnt that a valid character set or does it need to be written some other way ?

and shouldnt the file be opened using global encoding value ?

see 107910 also.


ken.frank@sun.com
Comment 5 Ken Frank 2007-06-28 00:20:57 UTC
Yardus,

does all this work now together as to web apps project encoding property read and write  and jsp file encodings as per
97871 and 107919, which are now resolved ?

but in  97871 I dont think should open files using utf-8 but using the global file encoding value ?

it says in 97871
The fix probably caused that a warning dialog appears when you create a web
project and it opens index.jsp file. Message is: 

The "ISO-8559-1" character set that is used in index.jsp is not a valid
character set for JSP Pages. Do you want to open the file using the UTF-8
character set?

---> but isnt that a valid character set or does it need to be written some other way ?

and shouldnt the file be opened using global encoding value ?

see 107910 also.


ken.frank@sun.com
Comment 6 J Bachorik 2007-06-28 07:35:37 UTC
ken, in the mentioned issue #97871 opening files using utf-8 is a previously existing functionality - if you feel a JSP
in a non-supported encoding should be opened in the project default encoding instead of the generic UTF-8 or the dialog
should be changed in any way, plz, file a bug or RFE against that functionality. this issue, according to the
description from tomas as the reporter, is only about providing the FEQ to other parts of NB and making sure javac is
able to pick the correct encoding. and this functionality is implemented and working correctly, I reckon. therefore
closing this issue
Comment 7 Ken Frank 2007-07-07 18:36:27 UTC
verified as to

if set the project encoding to different encoding, then new j2se or web project will use that encoding and show
it in the project properties

for checking if the javac uses the encoding argument, need to understand how to verify that part.

ken.frank@sun.com