X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=utf8.c;h=8f72f3ba23e6d2a764539d0fb4c672e98459a26f;hp=bed31abfacfacef66cfc0815286ef6b1a978b52e;hb=df70e07e24add1869bcc9b7af2277d9d0c09a281;hpb=31edbe030ac69952aa535730427246b5e9a1603c diff --git a/utf8.c b/utf8.c index bed31ab..8f72f3b 100644 --- a/utf8.c +++ b/utf8.c @@ -12,35 +12,28 @@ int mutt_wctoutf8 (char *s, unsigned int c) { - if (c < (1 << 7)) - { + if (c < (1 << 7)) { if (s) *s++ = c; return 1; } - else if (c < (1 << 11)) - { - if (s) - { + else if (c < (1 << 11)) { + if (s) { *s++ = 0xc0 | (c >> 6); *s++ = 0x80 | (c & 0x3f); } return 2; } - else if (c < (1 << 16)) - { - if (s) - { + else if (c < (1 << 16)) { + if (s) { *s++ = 0xe0 | (c >> 12); *s++ = 0x80 | ((c >> 6) & 0x3f); *s++ = 0x80 | (c & 0x3f); } return 3; } - else if (c < (1 << 21)) - { - if (s) - { + else if (c < (1 << 21)) { + if (s) { *s++ = 0xf0 | (c >> 18); *s++ = 0x80 | ((c >> 12) & 0x3f); *s++ = 0x80 | ((c >> 6) & 0x3f); @@ -48,10 +41,8 @@ int mutt_wctoutf8 (char *s, unsigned int c) } return 4; } - else if (c < (1 << 26)) - { - if (s) - { + else if (c < (1 << 26)) { + if (s) { *s++ = 0xf8 | (c >> 24); *s++ = 0x80 | ((c >> 18) & 0x3f); *s++ = 0x80 | ((c >> 12) & 0x3f); @@ -60,10 +51,8 @@ int mutt_wctoutf8 (char *s, unsigned int c) } return 5; } - else if (c < (1 << 31)) - { - if (s) - { + else if (c < (1 << 31)) { + if (s) { *s++ = 0xfc | (c >> 30); *s++ = 0x80 | ((c >> 24) & 0x3f); *s++ = 0x80 | ((c >> 18) & 0x3f);