asciiigi-utf8-akcenton.c
author viric@llimona
Sat, 08 Sep 2007 09:12:50 +0200
changeset 28 75b6d5659a19
parent 9 225d6c820d23
permissions -rw-r--r--
Better browser support.
viric@9
     1
#include <stdio.h>
viric@9
     2
viric@9
     3
int main()
viric@9
     4
{
viric@9
     5
    int i;
viric@9
     6
    int last;
viric@9
     7
viric@9
     8
    last = getchar();
viric@9
     9
    do
viric@9
    10
    {
viric@9
    11
        /* Unsigned char cast to int */
viric@9
    12
        i = getchar();
viric@9
    13
        if (i == EOF)
viric@9
    14
            break;
viric@9
    15
        if (!(last == 0xcc && i == 0x81))
viric@9
    16
        {
viric@9
    17
            putchar(last);
viric@9
    18
        }
viric@9
    19
        else
viric@9
    20
        {
viric@9
    21
            putchar('\'');
viric@9
    22
            i = getchar();
viric@9
    23
            if (i == EOF)
viric@9
    24
                /* We don't want the last putchar */
viric@9
    25
                return 0;
viric@9
    26
        }
viric@9
    27
        last = i;
viric@9
    28
    } while(1);
viric@9
    29
    putchar(last);
viric@9
    30
viric@9
    31
    return 0;
viric@9
    32
}