~ubuntu-branches/ubuntu/quantal/netbeans/quantal

« back to all changes in this revision

Viewing changes to usersguide/javahelp/org/netbeans/modules/usersguide/files/file_encoding.html

  • Committer: Bazaar Package Importer
  • Author(s): Marek Slama
  • Date: 2008-01-29 14:11:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080129141122-fnzjbo11ntghxfu7
Tags: upstream-6.0.1
Import upstream version 6.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<!--       
 
3
*     Copyright � 2007 Sun Microsystems, Inc. All rights reserved.
 
4
*     Use is subject to license terms.
 
5
-->
 
6
<html>
 
7
    <head>
 
8
        <title>About File Encodings</title>
 
9
        <link href="../ide.css" rel="stylesheet" type="text/css">
 
10
    </head>
 
11
    
 
12
    <body>
 
13
        <h2>About File Encodings</h2>
 
14
        
 
15
        <p><small><a href="#seealso">See Also</a></small></p>
 
16
 
 
17
        <p>When creating a file for a project, the files are created using the specified
 
18
            <a href="../project/proj_encoding.html">project encoding</a>. Some file types
 
19
            declare the encoding in the file, e.g. HTML, JSP, and XML files. Therefore,
 
20
            when the IDE creates these files, it automatically includes character encoding
 
21
            declarations in the file template.</p>
 
22
            
 
23
        <p>When determining the character encoding for a file, the IDE applies the 
 
24
            FileEncodingQuery (FEQ) layer model. It first determines whether the encoding
 
25
            is declared in the file. If no encoding declaration can be found, the IDE
 
26
            presumes the file encoding is specified by the project's encoding property. 
 
27
            If the project encoding is not specified (e.g. imported or older projects), 
 
28
            the IDE applies the encoding set by the environment in which it runs.</p>
 
29
 
 
30
        <h3>Setting Character Encoding for Files</h3>
 
31
        
 
32
        <p>To change the encoding for a file (e.g. HTMl, XML, or JSP files) you need 
 
33
            to change the encoding and charset specified in the corresponding tag in 
 
34
            the file. When an encoding is specified in a file, this setting overrides 
 
35
            the encoding set in the project.</p>        
 
36
        
 
37
        <h4>To manually change the character encoding for a file:</h4>        
 
38
        
 
39
        <ol>
 
40
            <li>Open the file in the Source editor.</li>
 
41
            <li>Modify the encoding and charset tags for the file, if available.</li>
 
42
        </ol>
 
43
        
 
44
        <br>
 
45
        <ul class="warning">
 
46
            <li>The IDE does not convert characters when the encoding of a file changes.
 
47
                If you manually change the encoding declaration within the file, and that 
 
48
                encoding does not match the project encoding, you may encounter problems when
 
49
                compiling and running the project. This is due to the fact that the encoding tag 
 
50
                affects how file contents are viewed internally - not only during runtime,
 
51
                but also during the design phase (i.e. adding content in the Source Editor).</li>
 
52
            <li>Manually changing the character encoding declaration within a file changes 
 
53
                how the IDE reads and displays that file. When you change the file encoding, 
 
54
                the IDE does not convert the existing contents of the file to the new encoding. 
 
55
                Care should be taken when changing the encoding of a file because the file 
 
56
                may contain characters that cannot be saved or that may not display properly 
 
57
                in the new encoding.</li>
 
58
        </ul>
 
59
  
 
60
        <dl>
 
61
            <dt><a name="seealso">See Also</a></dt>
 
62
            <dd><a href="../project/proj_encoding.html">About Project Encodings</a></dd>
 
63
        </dl>
 
64
        
 
65
        <hr>
 
66
        <small><a href="../credits.html">Legal Notices</a></small>
 
67
        
 
68
        <table border="0" cellpadding="50"><tr><td>&nbsp;</td></tr></table>
 
69
        
 
70
    </body>
 
71
</html>
 
 
b'\\ No newline at end of file'