Asciiigi utf8 surstrekojn
authorviric@llimona
Sun, 19 Aug 2007 11:23:57 +0200
changeset 9 225d6c820d23
parent 8 09ec33061ff3
child 10 188a0e3b3fb4
Asciiigi utf8 surstrekojn
Makefile
asciiigi-utf8-akcenton.c
--- a/Makefile	Tue Aug 14 22:18:46 2007 +0200
+++ b/Makefile	Sun Aug 19 11:23:57 2007 +0200
@@ -1,10 +1,11 @@
 CFLAGS=-O2 -g
 CC=gcc
 
-all: dictre idx2index trim-nou8 ia5
+all: dictre idx2index trim-nou8 ia5 asciiigi-utf8-akcenton
 
 idx2index: idx2index.o dict.o
 trim-nou8: trim-nou8.c
+asciiigi-utf8-akcenton: asciiigi-utf8-akcenton.c
 
 ia5: ia5.o dict.o
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/asciiigi-utf8-akcenton.c	Sun Aug 19 11:23:57 2007 +0200
@@ -0,0 +1,32 @@
+#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;
+}