Project Encoding vs. File Encoding – What are the precedence rules used in NetBeans 6.0?
NetBeans implements the FileEncodingQuery object (FEQ) to determine the language encoding for projects and files. The FEQ is an interface for obtaining information about which encoding should be used for reading from/writing to a particular file. It can be best defined as a layer model that adheres to the following precedence rules (level of importance from top to bottom): • file FEQ • project FEQ • fallback FEQ For example: • When the client requests the FEQ for the encoding of some object, it first asks the file FEQ. E.g., when the file is XML or HTML, it looks inside the file and returns either the declared encoding attribute, otherwise null. If the file FEQ is not null, the value is returned to the client, otherwise it continues: • If the file resides within a project that has implemented the FEQ, a request is made for the project FEQ. If the project FEQ is not null, the value is returned to the client, otherwise it continues: • If neither the file FEQ nor project FEQ cannot provid