X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=utf8.c;fp=utf8.c;h=0000000000000000000000000000000000000000;hp=35faa6cc4bd52ba2fca0354bb6436900093d44b1;hb=10e80e482eff3762b0b8d41b0c7795b76704479c;hpb=90c36546d834608e1ce96f4142ef9a1f6b405a7c diff --git a/utf8.c b/utf8.c deleted file mode 100644 index 35faa6c..0000000 --- a/utf8.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright notice from original mutt: - * [none] - * - * This file is part of mutt-ng, see http://www.muttng.org/. - * It's licensed under the GNU General Public License, - * please see the file GPL in the top level source directory. - */ - -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#ifndef HAVE_WC_FUNCS - -#include - -#ifndef EILSEQ -#define EILSEQ EINVAL -#endif - -int mutt_wctoutf8(char *p, unsigned int c) -{ - static unsigned char const mark[7] = { - 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC - }; - - int bytes; - - if (c >= 0x200000) { - errno = EILSEQ; - return -1; - } - - bytes = 1 + (c >= 0x80) + (c >= 0x800) + (c >= 0x10000); - p += bytes; - - switch (bytes) { - case 4: *--p = (c | 0x80) & 0xbf; c >>= 6; - case 3: *--p = (c | 0x80) & 0xbf; c >>= 6; - case 2: *--p = (c | 0x80) & 0xbf; c >>= 6; - case 1: *--p = c | mark[bytes]; - } - - return bytes; -} - -#endif /* !HAVE_WC_FUNCS */