mirror of
https://github.com/weechat/weechat.git
synced 2026-07-07 10:13:12 +02:00
api: return input string in function string_iconv_from_internal when current locale is wrong
This fixes a bug when writing configuration files with a wrong locale: now UTF-8 is kept and written in files instead of string converted using a wrong charset.
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
### Fixed
|
||||
|
||||
- relay: fix crash after `/upgrade` when relay clients are connected
|
||||
- core: save configuration files as UTF-8 when the locale is wrong
|
||||
- api: fix creation of empty buffer in function infolist_new_var_buffer
|
||||
- core: fix build with gcc 15 ([#2229](https://github.com/weechat/weechat/issues/2229), [#2230](https://github.com/weechat/weechat/issues/2230))
|
||||
- core: fix detection of dl library ([#2218](https://github.com/weechat/weechat/issues/2218))
|
||||
|
||||
@@ -3241,7 +3241,8 @@ string_iconv_to_internal (const char *charset, const char *string)
|
||||
}
|
||||
|
||||
/*
|
||||
* Converts internal string to terminal charset, for display.
|
||||
* Converts internal string to terminal charset, for display or write of
|
||||
* configuration files.
|
||||
*
|
||||
* Note: result must be freed after use.
|
||||
*/
|
||||
@@ -3258,6 +3259,10 @@ string_iconv_from_internal (const char *charset, const char *string)
|
||||
if (!input)
|
||||
return NULL;
|
||||
|
||||
/* if the locale is wrong, we keep UTF-8 */
|
||||
if (!weechat_locale_ok)
|
||||
return input;
|
||||
|
||||
/*
|
||||
* optimized for UTF-8: if charset is NULL => we use term charset => if
|
||||
* this charset is already UTF-8, then no iconv is needed
|
||||
|
||||
@@ -118,6 +118,7 @@ extern char *weechat_data_dir;
|
||||
extern char *weechat_state_dir;
|
||||
extern char *weechat_cache_dir;
|
||||
extern char *weechat_runtime_dir;
|
||||
extern int weechat_locale_ok;
|
||||
extern char *weechat_local_charset;
|
||||
extern int weechat_plugin_no_dlclose;
|
||||
extern int weechat_no_gnutls;
|
||||
|
||||
Reference in New Issue
Block a user