asciiigi-utf8-akcenton.c
author viric <viriketo@gmail.com>
Fri, 30 Mar 2012 18:54:55 +0200
changeset 31 2bcc08d0f1d8
parent 9 225d6c820d23
permissions -rw-r--r--
Fixing an error message
#include <stdio.h>

int main()
{
    int i;
    int last;

    last = getchar();
    do
    {
        /* Unsigned char cast to int */
        i = getchar();
        if (i == EOF)
            break;
        if (!(last == 0xcc && i == 0x81))
        {
            putchar(last);
        }
        else
        {
            putchar('\'');
            i = getchar();
            if (i == EOF)
                /* We don't want the last putchar */
                return 0;
        }
        last = i;
    } while(1);
    putchar(last);

    return 0;
}