mirror of
https://github.com/weechat/weechat.git
synced 2026-07-06 17:53:13 +02:00
Fixed charset conversions when locale is UTF-8 (added "look_charset_internal" option)
This commit is contained in:
@@ -18,7 +18,8 @@ Version 0.1.0 (under dev!):
|
||||
* new [irc] section in config file, option "look_display_away" moved to
|
||||
"irc_display_away"
|
||||
* server messages & errors are all prefixed (by 3 chars, like '-@-')
|
||||
* added new options for charset: look_charset_decode and look_charset_encode
|
||||
* added new options for charset (UTF-8 support): look_charset_decode,
|
||||
look_charset_encode and look_charset_internal
|
||||
* fixed many memory leaks
|
||||
* fixed colors bug: removed "gray" color (replaced by "default"), colors are
|
||||
ok when terminal has white (or light) background
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-01-16
|
||||
WeeChat FAQ, 2005-02-06
|
||||
=======================
|
||||
|
||||
Intended audience:
|
||||
@@ -65,12 +65,23 @@ A: For help you can type /help. For help about a command, type /help command.
|
||||
|
||||
2.3
|
||||
================================================================================
|
||||
Q: I don't see come chars with accents, what can I do?
|
||||
|
||||
A: You have to setup charset used for decoding, encoding, and internal WeeChat
|
||||
charset.
|
||||
Change value of option "look_charset_decode" to "UTF-8".
|
||||
Option "look_charset_internal" should not be changed (default is
|
||||
"ISO-8859-1").
|
||||
|
||||
|
||||
2.4
|
||||
================================================================================
|
||||
Q: How can I customize key bindings?
|
||||
|
||||
A: Today you can't do that. This is planed for a future version.
|
||||
|
||||
|
||||
2.4
|
||||
2.5
|
||||
================================================================================
|
||||
Q: How can I load Perl scripts?
|
||||
Are Perl scripts compatible with X-chat or/and Irssi ?
|
||||
@@ -83,14 +94,14 @@ A: You can use /perl command to load scripts
|
||||
sorry ;)
|
||||
|
||||
|
||||
2.5
|
||||
2.6
|
||||
================================================================================
|
||||
Q: How can I load Python scripts?
|
||||
|
||||
A: Today Python interface is not developed, so you can't load any Python script.
|
||||
|
||||
|
||||
2.6
|
||||
2.7
|
||||
================================================================================
|
||||
Q: How can I load Ruby scripts?
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-01-16
|
||||
WeeChat FAQ, 2005-02-06
|
||||
=======================
|
||||
|
||||
Public concerné :
|
||||
@@ -70,13 +70,24 @@ R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
|
||||
|
||||
2.3
|
||||
================================================================================
|
||||
Q: Je ne vois pas bien certains accents dans WeeChat, que faire ?
|
||||
|
||||
R: Il faut configurer le charset utilisé pour le décodage, l'encodage ainsi que
|
||||
le charset interne à WeeChat.
|
||||
Modifiez la valeur de l'option "look_charset_decode" en "UTF-8".
|
||||
L'option "look_charset_internal" ne devrait pas être modifiée (par défaut
|
||||
"ISO-8859-1").
|
||||
|
||||
|
||||
2.4
|
||||
================================================================================
|
||||
Q: Comment puis-je configurer les raccourcis clavier ?
|
||||
|
||||
R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
|
||||
version future.
|
||||
|
||||
|
||||
2.4
|
||||
2.5
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Perl ?
|
||||
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
|
||||
@@ -89,7 +100,7 @@ R: La commande /perl permet de charger les scripts Perl
|
||||
désolé ;)
|
||||
|
||||
|
||||
2.5
|
||||
2.6
|
||||
================================================================================
|
||||
Q: Comment puis-je charger les scripts Python ?
|
||||
|
||||
@@ -97,7 +108,7 @@ R: Aujourd'hui l'interface Python n'est pas d
|
||||
Vous ne pouvez donc charger aucun script Python.
|
||||
|
||||
|
||||
2.6
|
||||
2.7
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Ruby ?
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ int cfg_look_startup_version;
|
||||
char *cfg_look_weechat_slogan;
|
||||
char *cfg_look_charset_decode;
|
||||
char *cfg_look_charset_encode;
|
||||
char *cfg_look_charset_internal;
|
||||
int cfg_look_color_nicks;
|
||||
int cfg_look_color_actions;
|
||||
int cfg_look_remove_colors_from_msgs;
|
||||
@@ -106,6 +107,10 @@ t_config_option weechat_options_look[] =
|
||||
N_("charset for encoding messages sent to server, examples: UFT-8, ISO-8859-1 (if empty, local charset is used)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_look_charset_encode, config_change_buffer_content },
|
||||
{ "look_charset_internal", N_("internal WeeChat charset (should be ISO)"),
|
||||
N_("internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"ISO-8859-1", NULL, NULL, &cfg_look_charset_internal, config_change_buffer_content },
|
||||
{ "look_color_nicks", N_("display nick names with different colors"),
|
||||
N_("display nick names with different colors"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
|
||||
@@ -82,6 +82,7 @@ extern int cfg_look_startup_version;
|
||||
extern char *cfg_look_weechat_slogan;
|
||||
extern char *cfg_look_charset_decode;
|
||||
extern char *cfg_look_charset_encode;
|
||||
extern char *cfg_look_charset_internal;
|
||||
extern int cfg_look_color_nicks;
|
||||
extern int cfg_look_color_actions;
|
||||
extern int cfg_look_remove_colors_from_msgs;
|
||||
|
||||
@@ -354,7 +354,8 @@ gui_draw_buffer_title (t_gui_buffer *buffer, int erase)
|
||||
if (CHANNEL(buffer)->topic)
|
||||
{
|
||||
buf = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
local_charset,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
CHANNEL(buffer)->topic);
|
||||
mvwprintw (ptr_win->win_title, 0, 0, format, buf);
|
||||
free (buf);
|
||||
@@ -915,7 +916,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
t_weechat_hotlist *ptr_hotlist;
|
||||
char format_more[32];
|
||||
char format_more[32], *string;
|
||||
int i, first_mode;
|
||||
|
||||
/* make gcc happy */
|
||||
@@ -957,7 +958,14 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, "%s", SERVER(ptr_win->buffer)->name);
|
||||
if (SERVER(ptr_win->buffer)->is_away)
|
||||
wprintw (ptr_win->win_status, _("(away)"));
|
||||
{
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("(away)"));
|
||||
wprintw (ptr_win->win_status, string);
|
||||
free (string);
|
||||
}
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (ptr_win->win_status, "] ");
|
||||
@@ -1035,8 +1043,15 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
wprintw (ptr_win->win_status, "%d:<DCC> ",
|
||||
ptr_win->buffer->number);
|
||||
else
|
||||
wprintw (ptr_win->win_status, _("%d:[not connected] "),
|
||||
{
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("%d:[not connected] "));
|
||||
wprintw (ptr_win->win_status, string,
|
||||
ptr_win->buffer->number);
|
||||
free (string);
|
||||
}
|
||||
}
|
||||
|
||||
/* display list of other active windows (if any) with numbers */
|
||||
@@ -1046,7 +1061,12 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (ptr_win->win_status, "[");
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, _("Act: "));
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("Act: "));
|
||||
wprintw (ptr_win->win_status, string);
|
||||
free (string);
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist;
|
||||
ptr_hotlist = ptr_hotlist->next_hotlist)
|
||||
{
|
||||
@@ -1090,8 +1110,13 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (ptr_win->win_status, "[");
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, _("Lag: %.1f"),
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("Lag: %.1f"));
|
||||
wprintw (ptr_win->win_status, string,
|
||||
((float)(SERVER(ptr_win->buffer)->lag)) / 1000);
|
||||
free (string);
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (ptr_win->win_status, "]");
|
||||
@@ -1100,15 +1125,20 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
|
||||
/* display "-MORE-" if last line is not displayed */
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS_MORE);
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("-MORE-"));
|
||||
if (ptr_win->sub_lines > 0)
|
||||
mvwprintw (ptr_win->win_status, 0, ptr_win->win_width - 7,
|
||||
_("-MORE-"));
|
||||
"%s", string);
|
||||
else
|
||||
{
|
||||
snprintf (format_more, 32, "%%-%ds", strlen (_("-MORE-")));
|
||||
snprintf (format_more, 32, "%%-%ds", strlen (string));
|
||||
mvwprintw (ptr_win->win_status, 0, ptr_win->win_width - 7,
|
||||
format_more, " ");
|
||||
}
|
||||
free (string);
|
||||
|
||||
wrefresh (ptr_win->win_status);
|
||||
refresh ();
|
||||
@@ -2289,7 +2319,10 @@ gui_printf_color_type (t_gui_buffer *buffer, int type, int color, char *message,
|
||||
else
|
||||
buf2 = strdup (buf);
|
||||
|
||||
buf3 = weechat_convert_encoding (cfg_look_charset_decode, local_charset, buf2);
|
||||
buf3 = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
buf2);
|
||||
|
||||
if (gui_init_ok)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ gui_read_keyb ()
|
||||
int key, i;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
t_irc_server *ptr_server;
|
||||
char new_char[2];
|
||||
char new_char[3], *decoded_string;
|
||||
t_dcc *dcc_selected;
|
||||
|
||||
key = getch ();
|
||||
@@ -616,12 +616,28 @@ gui_read_keyb ()
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
new_char[0] = key;
|
||||
new_char[1] = '\0';
|
||||
decoded_string = NULL;
|
||||
|
||||
/* UTF-8 input */
|
||||
if (key == 0xC3)
|
||||
{
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
new_char[1] = key;
|
||||
new_char[2] = '\0';
|
||||
decoded_string = weechat_convert_encoding (local_charset, cfg_look_charset_internal, new_char);
|
||||
}
|
||||
}
|
||||
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
new_char,
|
||||
(decoded_string) ? decoded_string : new_char,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
|
||||
if (decoded_string)
|
||||
free (decoded_string);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,8 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
|
||||
va_end (argptr);
|
||||
|
||||
buf2 = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
local_charset,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
buffer);
|
||||
|
||||
ptr_infobar = (t_gui_infobar *)malloc (sizeof (t_gui_infobar));
|
||||
|
||||
@@ -395,7 +395,10 @@ server_sendf (t_irc_server * server, char *fmt, ...)
|
||||
gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer);
|
||||
buffer[size_buf - 2] = '\r';
|
||||
#endif
|
||||
buf2 = weechat_convert_encoding (local_charset, cfg_look_charset_encode, buffer);
|
||||
buf2 = weechat_convert_encoding ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
cfg_look_charset_encode,
|
||||
buffer);
|
||||
if (server_send (server, buf2, strlen (buf2)) <= 0)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
|
||||
+2
-1
@@ -18,7 +18,8 @@ Version 0.1.0 (under dev!):
|
||||
* new [irc] section in config file, option "look_display_away" moved to
|
||||
"irc_display_away"
|
||||
* server messages & errors are all prefixed (by 3 chars, like '-@-')
|
||||
* added new options for charset: look_charset_decode and look_charset_encode
|
||||
* added new options for charset (UTF-8 support): look_charset_decode,
|
||||
look_charset_encode and look_charset_internal
|
||||
* fixed many memory leaks
|
||||
* fixed colors bug: removed "gray" color (replaced by "default"), colors are
|
||||
ok when terminal has white (or light) background
|
||||
|
||||
+15
-4
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-01-16
|
||||
WeeChat FAQ, 2005-02-06
|
||||
=======================
|
||||
|
||||
Intended audience:
|
||||
@@ -65,12 +65,23 @@ A: For help you can type /help. For help about a command, type /help command.
|
||||
|
||||
2.3
|
||||
================================================================================
|
||||
Q: I don't see come chars with accents, what can I do?
|
||||
|
||||
A: You have to setup charset used for decoding, encoding, and internal WeeChat
|
||||
charset.
|
||||
Change value of option "look_charset_decode" to "UTF-8".
|
||||
Option "look_charset_internal" should not be changed (default is
|
||||
"ISO-8859-1").
|
||||
|
||||
|
||||
2.4
|
||||
================================================================================
|
||||
Q: How can I customize key bindings?
|
||||
|
||||
A: Today you can't do that. This is planed for a future version.
|
||||
|
||||
|
||||
2.4
|
||||
2.5
|
||||
================================================================================
|
||||
Q: How can I load Perl scripts?
|
||||
Are Perl scripts compatible with X-chat or/and Irssi ?
|
||||
@@ -83,14 +94,14 @@ A: You can use /perl command to load scripts
|
||||
sorry ;)
|
||||
|
||||
|
||||
2.5
|
||||
2.6
|
||||
================================================================================
|
||||
Q: How can I load Python scripts?
|
||||
|
||||
A: Today Python interface is not developed, so you can't load any Python script.
|
||||
|
||||
|
||||
2.6
|
||||
2.7
|
||||
================================================================================
|
||||
Q: How can I load Ruby scripts?
|
||||
|
||||
|
||||
+15
-4
@@ -1,4 +1,4 @@
|
||||
WeeChat FAQ, 2005-01-16
|
||||
WeeChat FAQ, 2005-02-06
|
||||
=======================
|
||||
|
||||
Public concerné :
|
||||
@@ -70,13 +70,24 @@ R: Pour obtenir de l'aide tapez /help. Pour de l'aide sur une commande,
|
||||
|
||||
2.3
|
||||
================================================================================
|
||||
Q: Je ne vois pas bien certains accents dans WeeChat, que faire ?
|
||||
|
||||
R: Il faut configurer le charset utilisé pour le décodage, l'encodage ainsi que
|
||||
le charset interne à WeeChat.
|
||||
Modifiez la valeur de l'option "look_charset_decode" en "UTF-8".
|
||||
L'option "look_charset_internal" ne devrait pas être modifiée (par défaut
|
||||
"ISO-8859-1").
|
||||
|
||||
|
||||
2.4
|
||||
================================================================================
|
||||
Q: Comment puis-je configurer les raccourcis clavier ?
|
||||
|
||||
R: Aujourd'hui vous ne pouvez pas le faire. Ce sera possible dans une
|
||||
version future.
|
||||
|
||||
|
||||
2.4
|
||||
2.5
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Perl ?
|
||||
Les scripts Perl sont-ils compatibles avec X-chat et/ou Irssi ?
|
||||
@@ -89,7 +100,7 @@ R: La commande /perl permet de charger les scripts Perl
|
||||
désolé ;)
|
||||
|
||||
|
||||
2.5
|
||||
2.6
|
||||
================================================================================
|
||||
Q: Comment puis-je charger les scripts Python ?
|
||||
|
||||
@@ -97,7 +108,7 @@ R: Aujourd'hui l'interface Python n'est pas d
|
||||
Vous ne pouvez donc charger aucun script Python.
|
||||
|
||||
|
||||
2.6
|
||||
2.7
|
||||
================================================================================
|
||||
Q: Comment puis-je charger des scripts Ruby ?
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ int cfg_look_startup_version;
|
||||
char *cfg_look_weechat_slogan;
|
||||
char *cfg_look_charset_decode;
|
||||
char *cfg_look_charset_encode;
|
||||
char *cfg_look_charset_internal;
|
||||
int cfg_look_color_nicks;
|
||||
int cfg_look_color_actions;
|
||||
int cfg_look_remove_colors_from_msgs;
|
||||
@@ -106,6 +107,10 @@ t_config_option weechat_options_look[] =
|
||||
N_("charset for encoding messages sent to server, examples: UFT-8, ISO-8859-1 (if empty, local charset is used)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"", NULL, NULL, &cfg_look_charset_encode, config_change_buffer_content },
|
||||
{ "look_charset_internal", N_("internal WeeChat charset (should be ISO)"),
|
||||
N_("internal WeeChat charset, should be ISO-xxxx even if locale is UTF-8 (if empty, local charset is used)"),
|
||||
OPTION_TYPE_STRING, 0, 0, 0,
|
||||
"ISO-8859-1", NULL, NULL, &cfg_look_charset_internal, config_change_buffer_content },
|
||||
{ "look_color_nicks", N_("display nick names with different colors"),
|
||||
N_("display nick names with different colors"),
|
||||
OPTION_TYPE_BOOLEAN, BOOL_FALSE, BOOL_TRUE, BOOL_TRUE,
|
||||
|
||||
@@ -82,6 +82,7 @@ extern int cfg_look_startup_version;
|
||||
extern char *cfg_look_weechat_slogan;
|
||||
extern char *cfg_look_charset_decode;
|
||||
extern char *cfg_look_charset_encode;
|
||||
extern char *cfg_look_charset_internal;
|
||||
extern int cfg_look_color_nicks;
|
||||
extern int cfg_look_color_actions;
|
||||
extern int cfg_look_remove_colors_from_msgs;
|
||||
|
||||
@@ -354,7 +354,8 @@ gui_draw_buffer_title (t_gui_buffer *buffer, int erase)
|
||||
if (CHANNEL(buffer)->topic)
|
||||
{
|
||||
buf = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
local_charset,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
CHANNEL(buffer)->topic);
|
||||
mvwprintw (ptr_win->win_title, 0, 0, format, buf);
|
||||
free (buf);
|
||||
@@ -915,7 +916,7 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
{
|
||||
t_gui_window *ptr_win;
|
||||
t_weechat_hotlist *ptr_hotlist;
|
||||
char format_more[32];
|
||||
char format_more[32], *string;
|
||||
int i, first_mode;
|
||||
|
||||
/* make gcc happy */
|
||||
@@ -957,7 +958,14 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, "%s", SERVER(ptr_win->buffer)->name);
|
||||
if (SERVER(ptr_win->buffer)->is_away)
|
||||
wprintw (ptr_win->win_status, _("(away)"));
|
||||
{
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("(away)"));
|
||||
wprintw (ptr_win->win_status, string);
|
||||
free (string);
|
||||
}
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (ptr_win->win_status, "] ");
|
||||
@@ -1035,8 +1043,15 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
wprintw (ptr_win->win_status, "%d:<DCC> ",
|
||||
ptr_win->buffer->number);
|
||||
else
|
||||
wprintw (ptr_win->win_status, _("%d:[not connected] "),
|
||||
{
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("%d:[not connected] "));
|
||||
wprintw (ptr_win->win_status, string,
|
||||
ptr_win->buffer->number);
|
||||
free (string);
|
||||
}
|
||||
}
|
||||
|
||||
/* display list of other active windows (if any) with numbers */
|
||||
@@ -1046,7 +1061,12 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (ptr_win->win_status, "[");
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, _("Act: "));
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("Act: "));
|
||||
wprintw (ptr_win->win_status, string);
|
||||
free (string);
|
||||
for (ptr_hotlist = hotlist; ptr_hotlist;
|
||||
ptr_hotlist = ptr_hotlist->next_hotlist)
|
||||
{
|
||||
@@ -1090,8 +1110,13 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (ptr_win->win_status, "[");
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS);
|
||||
wprintw (ptr_win->win_status, _("Lag: %.1f"),
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("Lag: %.1f"));
|
||||
wprintw (ptr_win->win_status, string,
|
||||
((float)(SERVER(ptr_win->buffer)->lag)) / 1000);
|
||||
free (string);
|
||||
gui_window_set_color (ptr_win->win_status,
|
||||
COLOR_WIN_STATUS_DELIMITERS);
|
||||
wprintw (ptr_win->win_status, "]");
|
||||
@@ -1100,15 +1125,20 @@ gui_draw_buffer_status (t_gui_buffer *buffer, int erase)
|
||||
|
||||
/* display "-MORE-" if last line is not displayed */
|
||||
gui_window_set_color (ptr_win->win_status, COLOR_WIN_STATUS_MORE);
|
||||
string = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
_("-MORE-"));
|
||||
if (ptr_win->sub_lines > 0)
|
||||
mvwprintw (ptr_win->win_status, 0, ptr_win->win_width - 7,
|
||||
_("-MORE-"));
|
||||
"%s", string);
|
||||
else
|
||||
{
|
||||
snprintf (format_more, 32, "%%-%ds", strlen (_("-MORE-")));
|
||||
snprintf (format_more, 32, "%%-%ds", strlen (string));
|
||||
mvwprintw (ptr_win->win_status, 0, ptr_win->win_width - 7,
|
||||
format_more, " ");
|
||||
}
|
||||
free (string);
|
||||
|
||||
wrefresh (ptr_win->win_status);
|
||||
refresh ();
|
||||
@@ -2289,7 +2319,10 @@ gui_printf_color_type (t_gui_buffer *buffer, int type, int color, char *message,
|
||||
else
|
||||
buf2 = strdup (buf);
|
||||
|
||||
buf3 = weechat_convert_encoding (cfg_look_charset_decode, local_charset, buf2);
|
||||
buf3 = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
buf2);
|
||||
|
||||
if (gui_init_ok)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,7 @@ gui_read_keyb ()
|
||||
int key, i;
|
||||
t_gui_buffer *ptr_buffer;
|
||||
t_irc_server *ptr_server;
|
||||
char new_char[2];
|
||||
char new_char[3], *decoded_string;
|
||||
t_dcc *dcc_selected;
|
||||
|
||||
key = getch ();
|
||||
@@ -616,12 +616,28 @@ gui_read_keyb ()
|
||||
"[Debug] key pressed = %d, hex = %02X, octal = %o\n", key, key, key);*/
|
||||
new_char[0] = key;
|
||||
new_char[1] = '\0';
|
||||
decoded_string = NULL;
|
||||
|
||||
/* UTF-8 input */
|
||||
if (key == 0xC3)
|
||||
{
|
||||
if ((key = getch()) != ERR)
|
||||
{
|
||||
new_char[1] = key;
|
||||
new_char[2] = '\0';
|
||||
decoded_string = weechat_convert_encoding (local_charset, cfg_look_charset_internal, new_char);
|
||||
}
|
||||
}
|
||||
|
||||
gui_buffer_insert_string (gui_current_window->buffer,
|
||||
new_char,
|
||||
(decoded_string) ? decoded_string : new_char,
|
||||
gui_current_window->buffer->input_buffer_pos);
|
||||
gui_current_window->buffer->input_buffer_pos++;
|
||||
gui_draw_buffer_input (gui_current_window->buffer, 0);
|
||||
gui_current_window->buffer->completion.position = -1;
|
||||
|
||||
if (decoded_string)
|
||||
free (decoded_string);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,8 @@ gui_infobar_printf (int time_displayed, int color, char *message, ...)
|
||||
va_end (argptr);
|
||||
|
||||
buf2 = weechat_convert_encoding (cfg_look_charset_decode,
|
||||
local_charset,
|
||||
(cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
buffer);
|
||||
|
||||
ptr_infobar = (t_gui_infobar *)malloc (sizeof (t_gui_infobar));
|
||||
|
||||
@@ -395,7 +395,10 @@ server_sendf (t_irc_server * server, char *fmt, ...)
|
||||
gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer);
|
||||
buffer[size_buf - 2] = '\r';
|
||||
#endif
|
||||
buf2 = weechat_convert_encoding (local_charset, cfg_look_charset_encode, buffer);
|
||||
buf2 = weechat_convert_encoding ((cfg_look_charset_internal && cfg_look_charset_internal[0]) ?
|
||||
cfg_look_charset_internal : local_charset,
|
||||
cfg_look_charset_encode,
|
||||
buffer);
|
||||
if (server_send (server, buf2, strlen (buf2)) <= 0)
|
||||
{
|
||||
irc_display_prefix (server->buffer, PREFIX_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user