mirror of
https://github.com/irssi/irssi.git
synced 2026-08-09 20:00:23 +02:00
Add public is_utf8 function by refactoring existing code.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4368 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
6e3870af5c
commit
3cdf50170f
3 changed files with 15 additions and 15 deletions
|
|
@ -25,7 +25,6 @@
|
|||
#include "lib-config/iconfig.h"
|
||||
#include "misc.h"
|
||||
|
||||
#ifdef HAVE_GLIB2
|
||||
static gboolean recode_get_charset(const char **charset)
|
||||
{
|
||||
*charset = settings_get_str("term_charset");
|
||||
|
|
@ -33,9 +32,19 @@ static gboolean recode_get_charset(const char **charset)
|
|||
/* we use the same test as in src/fe-text/term.c:123 */
|
||||
return !g_strcasecmp(*charset, "utf-8");
|
||||
|
||||
#ifdef HAVE_GLIB2
|
||||
return g_get_charset(charset);
|
||||
}
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
gboolean is_utf8(void)
|
||||
{
|
||||
const char *charset;
|
||||
|
||||
return recode_get_charset(&charset);
|
||||
}
|
||||
|
||||
static gboolean is_translit(const char *charset)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
char *recode_in (const SERVER_REC *server, const char *str, const char *target);
|
||||
char *recode_out (const SERVER_REC *server, const char *str, const char *target);
|
||||
gboolean is_valid_charset(const char *charset);
|
||||
gboolean is_utf8(void);
|
||||
|
||||
void recode_init (void);
|
||||
void recode_deinit (void);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue