summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--po/cs.po9
-rw-r--r--po/de.po9
-rw-r--r--po/es.po9
-rw-r--r--po/fr.po14
-rw-r--r--po/hu.po9
-rw-r--r--po/it.po9
-rw-r--r--po/ja.po9
-rw-r--r--po/pl.po9
-rw-r--r--po/pt_BR.po9
-rw-r--r--po/ru.po9
-rw-r--r--po/weechat.pot9
-rw-r--r--src/plugins/charset/charset.c61
13 files changed, 147 insertions, 22 deletions
diff --git a/ChangeLog b/ChangeLog
index 9af7aceff..39b5ba054 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
-v0.3.9-dev, 2012-07-13
+v0.3.9-dev, 2012-07-14
Version 0.3.9 (under dev!)
@@ -30,6 +30,8 @@ Version 0.3.9 (under dev!)
command /aspell (rename options enable/disable/dictlist to
setdict/deldict/listdict), display aspell status with /aspell (task #11988)
* aspell: add missing dictionaries (ast/grc/hus/kn/ky)
+* charset: do not allow "UTF-8" in charset options (useless because UTF-8 is the
+ internal WeeChat charset)
* guile: fix crash when unloading a script without pointer to interpreter
* guile: fix path of guile include dirs in cmake build (patch #7790)
* irc: add bar item "buffer_modes", remove option irc.look.item_channel_modes
diff --git a/po/cs.po b/po/cs.po
index c5f56250e..848782790 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3756,6 +3756,13 @@ msgid "%s%s: not enough memory to create new speller"
msgstr "%s%s: nedostatek paměti pro vytvoření kontroly pravopisu"
#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
+#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s%s: chyba vytváření znakové sady \"%s\" => \"%s\""
diff --git a/po/de.po b/po/de.po
index 6cb19d86e..4cfe27e66 100644
--- a/po/de.po
+++ b/po/de.po
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: 2012-06-30 14:28+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -4114,6 +4114,13 @@ msgid "%s%s: not enough memory to create new speller"
msgstr "%s%s: Nicht genug Speicher um neue Rechtschreibung zu erstellen"
#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
+#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s%s: Fehler bei der Erstellung des Zeichensatzes \"%s\" => \"%s\""
diff --git a/po/es.po b/po/es.po
index 3466a3e40..dce8f5d22 100644
--- a/po/es.po
+++ b/po/es.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3953,6 +3953,13 @@ msgid "%s%s: not enough memory to create new speller"
msgstr "%s%s: no hay suficiente memoria para crear el nuevo deletreador"
#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
+#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s%s: error al crear el set de caracteres \"%s\" => \"%s\""
diff --git a/po/fr.po b/po/fr.po
index 733bd5e8c..3b55aa4f0 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
-"PO-Revision-Date: 2012-07-13 10:57+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
+"PO-Revision-Date: 2012-07-14 10:46+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -3990,6 +3990,16 @@ msgid "%s%s: not enough memory to create new speller"
msgstr "%s%s: pas assez de mémoire pour créer un nouveau speller"
#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+"%s%s: UTF-8 n'est pas autorisé dans les options de charset (c'est le charset "
+"interne et par défaut: l'encodage par défaut est UTF-8 et le décodage "
+"d'UTF-8 est OK même si vous spécifiez un autre charset à décoder)"
+
+#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s%s: erreur en création du charset \"%s\" => \"%s\""
diff --git a/po/hu.po b/po/hu.po
index 6c6b22d66..0ef55def3 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3384,6 +3384,13 @@ msgstr ""
msgid "%s%s: not enough memory to create new speller"
msgstr "%s nincs elegendő memória új DCC számára\n"
+#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
#, fuzzy, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s nincs elég memória az információs pult üzenethez\n"
diff --git a/po/it.po b/po/it.po
index d6b3528cb..fd8c0ddcd 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3943,6 +3943,13 @@ msgid "%s%s: not enough memory to create new speller"
msgstr "%s%s: memoria non sufficiente per creare un nuovo controllore"
#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
+#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr ""
"%s%s: errore durante la creazione del set di caratteri \"%s\" => \"%s\""
diff --git a/po/ja.po b/po/ja.po
index 540b08765..25d13fdf2 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@@ -3842,6 +3842,13 @@ msgid "%s%s: not enough memory to create new speller"
msgstr "%s%s: 新しい speller を作る十分なメモリがありません"
#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
+#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s%s: 文字集合 \"%s\" => \"%s\" の作成中にエラー"
diff --git a/po/pl.po b/po/pl.po
index f330e62ce..4293c47ad 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3931,6 +3931,13 @@ msgid "%s%s: not enough memory to create new speller"
msgstr "%s%s: za mało pamięci na utworzenie nowego słownika"
#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
+#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s%s: błąd przy tworzeniu zestawu znaków (kodowania) \"%s\" => \"%s\""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index cadc8c9fc..b3ebbe937 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3809,6 +3809,13 @@ msgid "%s%s: not enough memory to create new speller"
msgstr "%s%s: memória insuficiente para criar novo verificador ortográfico"
#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
+#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s%s: erro ao criar charset \"%s\" => \"%s\""
diff --git a/po/ru.po b/po/ru.po
index 7d99a570b..5d7b57412 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3414,6 +3414,13 @@ msgstr ""
msgid "%s%s: not enough memory to create new speller"
msgstr "%s недостаточно памяти для нового DCC\n"
+#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
#, fuzzy, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr "%s недостаточно памяти для сообщения в строке информации\n"
diff --git a/po/weechat.pot b/po/weechat.pot
index 16c1eaf3e..e3f22c93a 100644
--- a/po/weechat.pot
+++ b/po/weechat.pot
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2012-07-13 10:55+0200\n"
+"POT-Creation-Date: 2012-07-14 10:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2985,6 +2985,13 @@ msgid "%s%s: not enough memory to create new speller"
msgstr ""
#, c-format
+msgid ""
+"%s%s: UTF-8 is now allowed in charset options (it is internal and default "
+"charset: default encode is UTF-8 and decode of UTF-8 is OK even if you "
+"specify another charset to decode)"
+msgstr ""
+
+#, c-format
msgid "%s%s: error creating charset \"%s\" => \"%s\""
msgstr ""
diff --git a/src/plugins/charset/charset.c b/src/plugins/charset/charset.c
index adfb8b984..9b0b47942 100644
--- a/src/plugins/charset/charset.c
+++ b/src/plugins/charset/charset.c
@@ -74,6 +74,46 @@ charset_config_reload (void *data, struct t_config_file *config_file)
}
/*
+ * charset_is_allowed: check if charset is allowed (different from "UTF-8",
+ * which is the internal charset)
+ * return 1 if charset is allowed, otherwise 0
+ * (and error is displayed)
+ */
+
+int
+charset_is_allowed (const char *charset)
+{
+ if (weechat_strcasestr (charset, "utf-8")
+ || weechat_strcasestr (charset, "utf8"))
+ {
+ weechat_printf (NULL,
+ _("%s%s: UTF-8 is now allowed in charset options (it "
+ "is internal and default charset: default encode "
+ "is UTF-8 and decode of UTF-8 is OK even if you "
+ "specify another charset to decode)"),
+ weechat_prefix ("error"), CHARSET_PLUGIN_NAME);
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * charset_check_charset_cb: callback called to check the charset value
+ */
+
+int
+charset_check_charset_cb (void *data, struct t_config_option *option,
+ const char *value)
+{
+ /* make C compiler happy */
+ (void) data;
+ (void) option;
+
+ return charset_is_allowed (value);
+}
+
+/*
* charset_config_create_option: set a charset
*/
@@ -108,13 +148,16 @@ charset_config_create_option (void *data, struct t_config_file *config_file,
{
if (value && value[0])
{
- ptr_option = weechat_config_new_option (
- config_file, section,
- option_name, "string", NULL,
- NULL, 0, 0, "", value, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
- rc = (ptr_option) ?
- WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
+ if (charset_is_allowed (value))
+ {
+ ptr_option = weechat_config_new_option (
+ config_file, section,
+ option_name, "string", NULL,
+ NULL, 0, 0, "", value, 0,
+ &charset_check_charset_cb, NULL, NULL, NULL, NULL, NULL);
+ rc = (ptr_option) ?
+ WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR;
+ }
}
else
rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
@@ -167,13 +210,13 @@ charset_config_init ()
&& (strcasecmp (charset_terminal,
charset_internal) != 0)) ?
charset_terminal : "iso-8859-1", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ &charset_check_charset_cb, NULL, NULL, NULL, NULL, NULL);
charset_default_encode = weechat_config_new_option (
charset_config_file, ptr_section,
"encode", "string",
N_("global encoding charset"),
NULL, 0, 0, "", NULL, 0,
- NULL, NULL, NULL, NULL, NULL, NULL);
+ &charset_check_charset_cb, NULL, NULL, NULL, NULL, NULL);
ptr_section = weechat_config_new_section (charset_config_file, "decode",
1, 1,