8aae342458
Deleted all jpg images and replaced them by png images. Updated date in documentation and manpage. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1135 ea778897-0a13-0410-b9d1-a72fbfd435f5
61 lines
6.4 KiB
HTML
61 lines
6.4 KiB
HTML
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Character sets and Unicode Byte-Order-Mark (BOM)</title><link rel="stylesheet" href="geany.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.0"><link rel="start" href="index.html" title="Geany 0.10"><link rel="up" href="ch03.html" title="Chapter 3. Usage"><link rel="prev" href="ch03s03.html" title="General"><link rel="next" href="ch03s05.html" title="Search, replace and go to"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Character sets and Unicode Byte-Order-Mark (BOM)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch03s03.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Usage</th><td width="20%" align="right"> <a accesskey="n" href="ch03s05.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="charset"></a>Character sets and Unicode Byte-Order-Mark (BOM)</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2794005"></a>Using character sets</h3></div></div></div><p>
|
||
<span class="application">Geany</span> provides support for detecting and converting
|
||
character sets. So you can open and save files in different character sets and
|
||
even can convert a file from a character set to another one.
|
||
To do this, <span class="application">Geany</span> uses the character conversion
|
||
capabilities of the GLib.
|
||
</p><p>
|
||
Only text files are supported, i.e. opening files which contain NUL-bytes may
|
||
fail. <span class="application">Geany</span> will try to open the file anyway but it
|
||
is likely that the file will be truncated because it can only opened up to the
|
||
first occurrence of the first NUL-byte. All characters after this position are
|
||
lost and are not written when you save the file.
|
||
</p><p>
|
||
<span class="application">Geany</span> tries to detect the encoding of a file while
|
||
opening it. It might be that the encoding of a file cannot be detected correctly
|
||
so you have to set manually the encoding of the file in order to display it
|
||
correctly. You can this in the file open dialog by selecting an encoding in the
|
||
drop down box or by reloading the file with the file menu item "Reload as".
|
||
The auto detection works well for most encodings but there are also some encodings
|
||
known where auto detection has its problems. Auto detecting the encoding of a file
|
||
is not easy and sometimes an encoding might be detected not correctly.
|
||
</p><p>
|
||
There are different ways to use different encodings in <span class="application">Geany</span>:
|
||
</p><div class="orderedlist"><ol type="1"><li><p>Using the file open dialog</p><p>This opens the file with the encoding specified in the encoding
|
||
drop down box. If the encoding is set to "Detect from file"
|
||
auto detection will be used. If the encoding is set to
|
||
"Without encoding (None)" the file will be opened without any
|
||
character conversion and <span class="application">Geany</span> will
|
||
not try to auto detect the encoding(see below for more information).
|
||
</p></li><li><p>Using the "Reload as" menu item</p><p>This item reloads the current file with the specified encoding.
|
||
It can help if you opened a file and found out that a wrong
|
||
encoding was used.
|
||
</p></li><li><p>Using the "Set encoding" menu item</p><p>In contrary to the above two options, this will not change or
|
||
reload the current file unless you save it. It is useful when
|
||
you want to change the encoding of the file.</p></li></ol></div><p>
|
||
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2794136"></a>Special encoding "None"</h3></div></div></div><p>
|
||
There is a special encoding "None" which is actually no real encoding. It is
|
||
useful when you know that Geany cannot auto detect the encoding of a file and
|
||
it is not displayed correctly. Especially when the file contains NUL-bytes this
|
||
can be useful to skip auto detection and open the file properly at least until
|
||
the occurrence of the first NUL-byte. Using this encoding opens the file as it
|
||
is without any character conversion.
|
||
</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2794154"></a>Unicode Byte-Order-Mark (BOM)</h3></div></div></div><p>
|
||
Furthermore, <span class="application">Geany</span> detects an Unicode Byte Order Mark
|
||
(see <a href="http://en.wikipedia.org/wiki/Byte_Order_Mark" target="_top">
|
||
<em class="citetitle">http://en.wikipedia.org/wiki/Byte_Order_Mark</em>
|
||
</a> for details). Of course, this feature is only available if the opened file
|
||
is in an unicode encoding. The Byte Order Mark helps to detect the encoding of a
|
||
file, e.g. whether it is UTF-16LE or UTF-16BE and so on. On Unix-like systems using
|
||
a Byte Order Mark could cause some problems, e.g. the gcc stops with stray errors,
|
||
PHP does not parse a script containing a BOM and script files starting with a
|
||
she-bang maybe cannot be started.
|
||
In the status bar you can easily see whether the file starts with a BOM or not.
|
||
If you want to set a BOM for a file or if you want to remove it from a file, just
|
||
use the document menu and toggle the checkbox.
|
||
</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
|
||
If you are unsure what a BOM is or if you do not understand where to use it,
|
||
then it is not important for you and you can safely ignore it.
|
||
</p></div><p>
|
||
</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">General </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Search, replace and go to</td></tr></table></div></body></html>
|