Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 97861 - Update properties data object to use FileEncodingQuery
Update properties data object to use FileEncodingQuery
Product: utilities
Classification: Unclassified
Component: Properties
All All
: P2 (vote)
: 6.x
Assigned To: Marian Petras
Depends on: 42638
Blocks: 89720 90863 97848
  Show dependency treegraph
Reported: 2007-03-14 16:26 UTC by Tomas Zezula
Modified: 2007-06-20 19:00 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Zezula 2007-03-14 16:26:47 UTC
The properties file should use FEQ, see discussion in
Comment 1 Marian Petras 2007-03-23 14:36:17 UTC
Comment 2 Marian Petras 2007-04-18 16:19:35 UTC
Fixed in the trunk.

The change resolved also the following issues:
 - issue 89720 ("Cannot display Chinese characters in properties file") 
 - issue 35159 ("Allow searching non-English properties files") 
 - issue 32392 ("Edit Text Rather than Escape Sequences")

Modified files:
   ide/golden/deps.txt   (1.543)
   properties/   (1.69)
   properties/nbproject/project.xml   (1.12)
                                (1.1 - new)
                                (1.1 - new)

Comment 3 Marian Petras 2007-04-26 14:05:12 UTC
There was a bug in it - see issue #101732. When porting this change remember to
also port the fix:

Modified files:
properties/src/org/netbeans/modules/properties/   (1.3)

Comment 4 Ken Frank 2007-05-29 18:44:05 UTC
I want to verify this and the others mentioned - some questions that will help
in doing this:

for 32392, what is the user model ?  in that issue one comment was that they 
did not want to need to see the escapped ascii in even the text version of the props
file but its still there now in nb6.

for 35159, i asked in that issue a clarification about verifying it - can you
look at it ?

for 89720, please see my question in that issue also.
Comment 5 Marian Petras 2007-06-20 19:00:05 UTC
The model is that .properties files use a special encoding which translates \uxxxx sequences to the corresponding
characters (when reading) and vice versa (when writing). The automatic result of the use of the special encoding is that
whoever reads the file with the proper encoding (i.e. the one obtained via FileEncodingQuery.getEncoding(...)), he gets
real characters in place of \uxxxx sequences. Because the editor uses the proper encoding, real characters are read (and
displayed) in place of the \uxxxx sequences. Similarly, whenever a .properties file is written to the disk, using
encoding obtained via FileEncodingQuery.getEncoding(...), all non-ASCII characters are written as \uxxxx sequences (on
the disk).

The Find feature is one such application of the encoding - while files are searched, they are read using the encoding
obtained from FileEncodingQuery.getEncoding(...) so the core searching routine reads the actual characters instead of
the \uxxxx sequences.

The editor of .properties files is just another application of the same mechanism - while file is being read from the
disk, the \uxxxx sequences are translated to actual characters so the editor only gets the result of the translation -
the actual characters - and displays them as such. Vice versa, when the editor is writing the modified file to the disk,
any non-ASCII characters are translated as \uxxxx sequences while writing and the editor does not need to know about it.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo