diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-11-08 07:54:33 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-11-08 07:54:33 +0000 |
commit | c20ce83d20526e24601c6c8acabc7a61ab3c3a78 (patch) | |
tree | a8e1b79498ef7cd410176680d9bfb585270aa576 /src/plugins/plugins-config.c | |
parent | b5a7d8e99e372378cb47069a3d2ad0bf65ccc530 (diff) | |
download | weechat-c20ce83d20526e24601c6c8acabc7a61ab3c3a78.zip |
Added charset plugin (WeeChat is now full UTF-8 for internal data storage), fixed compilation problems with FreeBSD, fixed status bar display bug
Diffstat (limited to 'src/plugins/plugins-config.c')
-rw-r--r-- | src/plugins/plugins-config.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/plugins/plugins-config.c b/src/plugins/plugins-config.c index e609f4422..833d47536 100644 --- a/src/plugins/plugins-config.c +++ b/src/plugins/plugins-config.c @@ -230,7 +230,7 @@ plugin_config_read () char *filename; FILE *file; int line_number; - char line[1024], *ptr_line, *pos, *pos2; + char line[1024], *ptr_line, *ptr_line2, *pos, *pos2; filename_length = strlen (weechat_home) + strlen (WEECHAT_PLUGINS_CONFIG_NAME) + 2; @@ -250,6 +250,14 @@ plugin_config_read () line_number++; if (ptr_line) { + /* encode line to internal charset */ + ptr_line2 = weechat_iconv_to_internal (NULL, ptr_line); + if (ptr_line2) + { + snprintf (line, sizeof (line) - 1, "%s", ptr_line2); + free (ptr_line2); + } + /* skip spaces */ while (ptr_line[0] == ' ') ptr_line++; @@ -357,19 +365,19 @@ plugin_config_write () } current_time = time (NULL); - fprintf (file, _("#\n# %s plugins configuration file, created by " - "%s v%s on %s"), - PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION, - ctime (¤t_time)); - fprintf (file, _("# WARNING! Be careful when editing this file, " - "WeeChat writes this file when options are updated.\n#\n")); + weechat_iconv_fprintf (file, _("#\n# %s plugins configuration file, created by " + "%s v%s on %s"), + PACKAGE_NAME, PACKAGE_NAME, PACKAGE_VERSION, + ctime (¤t_time)); + weechat_iconv_fprintf (file, _("# WARNING! Be careful when editing this file, " + "WeeChat writes this file when options are updated.\n#\n")); for (ptr_plugin_option = plugin_options; ptr_plugin_option; ptr_plugin_option = ptr_plugin_option->next_option) { - fprintf (file, "%s = \"%s\"\n", - ptr_plugin_option->name, - ptr_plugin_option->value); + weechat_iconv_fprintf (file, "%s = \"%s\"\n", + ptr_plugin_option->name, + ptr_plugin_option->value); } fclose (file); |