summaryrefslogtreecommitdiff
path: root/doc/en/user/plugin_charset.en.xml
blob: e9eb577c81bde893c2f28393be94c400b4d9544f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?xml version="1.0" encoding="UTF-8"?>

<!--

WeeChat documentation (english version)

Copyright (c) 2003-2009 by FlashCode <flashcode@flashtux.org>

This manual is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.

This manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.

-->

<section id="secPluginCharset">
  <title>Charset plugin</title>
  
  <para>
    Charset plugin lets you decode or encode data using charsets.
    There is default charset for decode/encode, and specific charsets
    for buffers (or group of buffers).
    This plugin is optional, but recommended: if it's not loaded, WeeChat
    can only read/write UTF-8 data.
  </para>
  
  <para>
    Charset plugin should be autoloaded by WeeChat at startup.
    To be sure plugin is loaded, try: <command>/charset</command>.
    If command is not found, then load plugin with command:
    <screen>/plugin load charset</screen>
    If plugin is not found, then you should compile again WeeChat with
    plugins and Charset support.
  </para>
  
  <para>
    When Charset plugin starts, it displays terminal and internal charsets.
    Terminal charset depends on your locale, and internal is UTF-8.
    For example :
    <screen>charset: terminal: ISO-8859-15, internal: UTF-8</screen>
  </para>
  
  <section id="secCharsetOptions">
    <title>Options (file charset.conf)</title>
    
    <para>
      &charset_options.xml;
    </para>
    
    <para>
      <itemizedlist>
        <listitem>
          <para>
            To set global decode and encode charsets, use command
            <command>/set</command>.
            For example:
<screen>
/set charset.default.decode ISO-8859-15
/set charset.default.encode ISO-8859-15
</screen>
            If global decode charset is not set (for example during first
            load of Charset plugin), it will be automatically set to terminal
            charset (if it's different from UTF-8), or by default to
            "<literal>ISO-8859-1</literal>".
            Default encode value is empty, so it sends by default with
            internal charset (UTF-8).
          </para>
        </listitem>
        <listitem>
          <para>
            To set IRC server charset, use command <command>/charset</command> on
            server buffer.
            If you give only charset, then it will set "decode" and "encode"
            values.
            For example:
            <screen>/charset ISO-8859-15</screen>
            It's equivalent to:
<screen>
/charset decode ISO-8859-15
/charset encode ISO-8859-15
</screen>
          </para>
        </listitem>
        <listitem>
          <para>
            To set IRC channel (or private) charset, use same commands as server,
            but on channel (or private) buffer.
          </para>
        </listitem>
        <listitem>
          <para>
            To set charset for all IRC channels (and privates) of an IRC server,
            use following command:
            <screen>/set charset.decode.irc.freenode ISO-8859-15</screen>
          </para>
        </listitem>
        <listitem>
          <para>
            To see all charsets used, use following command:
            <screen>/set charset.*</screen>
          </para>
        </listitem>
      </itemizedlist>
    </para>
    
  </section>
  
  <section id="secCharsetCommands">
    <title>Commands</title>
    
    <para>
      &charset_commands.xml;
    </para>
    
  </section>
  
  <section id="secCharsetFAQ">
    <title>FAQ</title>
    
    <para>
      If you have problems with chars or accents using Charset plugin:
      <itemizedlist>
        <listitem>
          <para>
            check that weechat-curses is linked to libncursesw (warning:
            needed on most distributions but not all) :
            <screen>ldd /path/to/weechat-curses</screen>
          </para>
        </listitem>
        <listitem>
          <para>
            check charset line (on WeeChat buffer), you should see
            ISO-XXXXXX or UTF-8 for terminal charset. If you see
            ANSI_X3.4-1968 or other values, probably your locale is wrong.
          </para>
        </listitem>
        <listitem>
          <para>
            setup global decode value, for example:
            <screen>/set charset.default.decode ISO-8859-15</screen>
          </para>
        </listitem>
      </itemizedlist>
    </para>
    
  </section>
  
</section>