The new SPI FileEncodingQueryImplementation allows IDE components like editor,
search, etc to handle correctly encoding of files. The implementation of
FileEncodingQueryImplementation should be provided in the project's lookup.
The typical implementation of this query uses a project property with encoding
and returns a Charset.forName (evaluator.getProperty(name_of_encoding_property).
The project should also provide a control in the project's customizer to allow
user to change the encoding of the project.
For more info see issue: #42638
as part of writing spec on the overall topic of project encoding properties, I asked this question to dev
and got the answer below:
### question - uml has reverse engineer java project and code generation in java projects - can there be a conflict if
uml assumes the java project encoding is that of locale user is in, but actual project and file encoding of the project
files is another encoding ? (since uml will not query for the feq ?)
If UML does not use FEQ when doing reverse engineering it will generate
wrong diagrams, even worse may be synchronization with original code, it
may corrupt the original java code.
I realize uml was not going to implement this issue for nb6, but am wondering if it would want to at
least for reading the project encoding of the java project, even if not provide the property ui on
its project properties ?
the uml does use FEQ query to determine the encoding of the file being REd or CGed.
If the query returns nothing then the IO API methods used that don't require
charset parameter, thus JVM default IO charset would be used in this case.
Thanks for confirming about it; I will update the spec/doc on the feq.
Now that nb6 is done, can we see if this can be done for uml
uml is the only project type that does not provide a choice for
*** Issue 123756 has been marked as a duplicate of this issue. ***
attached is a project from a user that has the encoding of some xml files,
"<?xml version="1.0" encoding="MS932"?>"
and others in utf-8 that might be related to this
problem - this situation has been seen in actual issue 123756 which
was closed as duplicate of this one - if 123756 seems to be separate
or should be left open for itself, please reopen it, and attach the attached project to it.
Created attachment 54614 [details]
will this task be done for 6.5 ?