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 97867 - Implement FileEncodingQueryImplementation for plain text files
Summary: Implement FileEncodingQueryImplementation for plain text files
Status: NEW
Alias: None
Product: ide
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Tomas Zezula
URL:
Keywords:
Depends on:
Blocks: 97848
  Show dependency tree
 
Reported: 2007-03-14 16:40 UTC by Tomas Zezula
Modified: 2012-09-18 14:46 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
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:40:21 UTC
It would be nice to implement a FileEncodingQueryImplementation for plain text
files which will be able to detect the correct encoding. Here is a link to the
java implementation of the Mozila's charset detection algorithm
http://jchardet.sourceforge.net/ , which may be helpful for this.
Comment 1 Ken Frank 2007-06-05 17:01:10 UTC
Based on discussion with Tomas and based on past voc from external users,
that this was something they wanted as much as they wanted the project encoding
property, am putting as a defect vs enhancement - please change back to enhancement
if this can't be done for nb6.

ken.frank@sun.com
Comment 2 Ken Frank 2007-07-16 20:05:51 UTC
does it mean that at the moment, all of the below kind of nb files don't have any file encoding
handling ?  

and is this issue about handling of encoding for all of them or just a plain text file ?

(I dont know if all are considered as text files vs being other non
text files)

if other issues/rfe are needed, let me know.

javascript
css
ant
json
jnlp
ruby files

ken.frank@sun.com
Comment 3 Antonin Nebuzelsky 2007-07-24 14:31:10 UTC
DefaultDataObject is handling the plain text file?
Comment 4 Jaroslav Tulach 2007-07-26 10:44:18 UTC
I do not think this should be implemented in openide/loaders and definitely not just for DefaultDataObject. Instead 
the fallback impl in ProjectEncodingQuery shall try as much as possible to guess the right type - e.g. reassigning 
back to Tomáš - the author of the query.

Maybe we can put this into some other module, but openide/loaders are more users of the query than providers (except 
the trick with dataObject.getLookup(), but that is just a bridge, no real impl).
Comment 5 Tomas Zezula 2007-07-26 12:09:08 UTC
It should be implemented in the module the text data type come from,and  this is not projects module. Similar case is
xml module implements it for XML data object, html module for html object, ....
Comment 6 Jaroslav Tulach 2007-07-27 10:55:21 UTC
See kfranks' comment:
> if other issues/rfe are needed, let me know.
> javascript, css, ant, json, jnlp, ruby files

the jnlp and ant files are XML, so ok, this should be done in XML. But for the others, we are facing a general 
problem, which, if we want to solve it should be solved in project/queries - e.g. the root place where the encoding 
API is defined.
Comment 7 Tomas Zezula 2007-08-16 08:11:31 UTC
Project/queries provides API/SPI and default fall back implementation.  This module knows nothing about the content of
the file. The openide/loaders provide base class for the DataObjects, so it's a natural place to put this FEQImpl in it.
Comment 8 Jaroslav Tulach 2007-08-16 10:57:02 UTC
openide/loaders can provide implementation for DefaultDataObject. But that does not solve the problem for other data 
object. I cannot fix this issue in loaders. Sorry.
Comment 9 Jaroslav Tulach 2007-08-30 09:28:21 UTC
I guess we agreed in caffeteria that Tomas will provide basic impl searching for unicode.
Comment 10 Tomas Zezula 2007-08-31 10:51:17 UTC
Not P2, NetBeans never had such a detection. Anyway I still think that Netbeans should have Open in Encoding action like
Visual Studio. The autodetection can detect only UTF charsets.
Comment 11 Lukas Hasik 2008-04-10 21:34:25 UTC
moving opened issues from TM <= 6.1 to TM=Dev
Comment 12 Tomas Zezula 2010-03-29 14:24:25 UTC
Open|Save in encoding available in contrib.
Comment 13 Jesse Glick 2012-09-18 14:46:52 UTC
NuclearRussian: please do not move Version forward.