Skip to content

Commit

Permalink
Add support for page koi8-r encoding
Browse files Browse the repository at this point in the history
Mirrors 1a7b95a that relates to #15 but for koi8-r.
  • Loading branch information
Dmitri Zakharchenko authored and eafer committed Sep 12, 2021
1 parent 18ffe3c commit 9bde19f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/rdrview.c
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,7 @@ static inline void assert_sandbox_works(void)
/* Descriptors for the encodings supported via iconv */
static iconv_t gb2312_cd;
static iconv_t cp1252_cd;
static iconv_t koi8r_cd;

/**
* Set up the iconv conversion descriptors to be used by libxml2. This is
Expand All @@ -788,6 +789,10 @@ static void init_iconv(void)
cp1252_cd = iconv_open("UTF-8", "CP1252");
if (cp1252_cd == (iconv_t)(-1))
fatal_errno();

koi8r_cd = iconv_open("UTF-8", "KOI8-R");
if (koi8r_cd == (iconv_t)(-1))
fatal_errno();
}

/**
Expand All @@ -797,6 +802,7 @@ static void clean_iconv(void)
{
iconv_close(gb2312_cd);
iconv_close(cp1252_cd);
iconv_close(koi8r_cd);
}

/**
Expand Down

0 comments on commit 9bde19f

Please sign in to comment.