"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/mx/iconv.c" between
s-nail-14.9.18.tar.xz and s-nail-14.9.19.tar.xz

About: S-nail is a mail processing system intended to provide the functionality of the POSIX mailx command and offers extensions for line editing, IDNA, MIME, S/MIME, SMTP and POP3 (and IMAP). It is usable as a mail batch language.

iconv.c  (s-nail-14.9.18.tar.xz):iconv.c  (s-nail-14.9.19.tar.xz)
skipping to change at line 88 skipping to change at line 88
cp = savestrbuf(cset, P2UZ(cp - cset)); cp = savestrbuf(cset, P2UZ(cp - cset));
for(tcp = cp; (tc = *tcp) != '\0'; ++tcp) for(tcp = cp; (tc = *tcp) != '\0'; ++tcp)
*tcp = su_cs_to_lower(tc); *tcp = su_cs_to_lower(tc);
if(c != '\0' && (n_poption & n_PO_D_V)) if(c != '\0' && (n_poption & n_PO_D_V))
n_err(_("Stripped off character set suffix: %s -> %s\n"), n_err(_("Stripped off character set suffix: %s -> %s\n"),
n_shexp_quote_cp(cset, FAL0), n_shexp_quote_cp(cp, FAL0)); n_shexp_quote_cp(cset, FAL0), n_shexp_quote_cp(cp, FAL0));
cset = cp; cset = cp;
} }
/* And some names just cannot be used as such */
if((!su_cs_cmp_case(cset, "unknown-8bit") ||
!su_cs_cmp_case(cset, "binary")) &&
(cset = ok_vlook(charset_unknown_8bit)) == NIL)
cset = ok_vlook(CHARSET_8BIT_OKEY);
jleave: jleave:
NYD2_OU; NYD2_OU;
return n_UNCONST(cset); return n_UNCONST(cset);
} }
boole boole
n_iconv_name_is_ascii(char const *cset){ /* TODO ctext/su */ n_iconv_name_is_ascii(char const *cset){ /* TODO ctext/su */
/* In reversed MIME preference order */ /* In reversed MIME preference order */
static char const * const names[] = {"csASCII", "cp367", "IBM367", "us", static char const * const names[] = {"csASCII", "cp367", "IBM367", "us",
"ISO646-US", "ISO_646.irv:1991", "ANSI_X3.4-1986", "iso-ir-6", "ISO646-US", "ISO_646.irv:1991", "ANSI_X3.4-1986", "iso-ir-6",
skipping to change at line 117 skipping to change at line 124
NYD2_OU; NYD2_OU;
return rv; return rv;
} }
#ifdef mx_HAVE_ICONV #ifdef mx_HAVE_ICONV
iconv_t iconv_t
n_iconv_open(char const *tocode, char const *fromcode){ n_iconv_open(char const *tocode, char const *fromcode){
iconv_t id; iconv_t id;
NYD_IN; NYD_IN;
if((!su_cs_cmp_case(fromcode, "unknown-8bit") || tocode = n_iconv_normalize_name(tocode);
!su_cs_cmp_case(fromcode, "binary")) && fromcode = n_iconv_normalize_name(fromcode);
(fromcode = ok_vlook(charset_unknown_8bit)) == NULL)
fromcode = ok_vlook(CHARSET_8BIT_OKEY);
id = iconv_open(tocode, fromcode); id = iconv_open(tocode, fromcode);
/* If the encoding names are equal at this point, they are just not /* If the encoding names are equal at this point, they are just not
* understood by iconv(), and we cannot sensibly use it in any way. We do * understood by iconv(), and we cannot sensibly use it in any way. We do
* not perform this as an optimization above since iconv() can otherwise be * not perform this as an optimization above since iconv() can otherwise be
* used to check the validity of the input even with identical encoding * used to check the validity of the input even with identical encoding
* names */ * names */
if (id == (iconv_t)-1 && !su_cs_cmp_case(tocode, fromcode)) if (id == (iconv_t)-1 && !su_cs_cmp_case(tocode, fromcode))
su_err_set_no(su_ERR_NONE); su_err_set_no(su_ERR_NONE);
 End of changes. 2 change blocks. 
4 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)