From 22301df1f4af5937bf96cb85091d5220d206d9bc Mon Sep 17 00:00:00 2001 From: james <> Date: Fri, 22 Feb 2008 19:12:05 +0000 Subject: *** empty log message *** --- src/utf8.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/utf8.c (limited to 'src/utf8.c') diff --git a/src/utf8.c b/src/utf8.c new file mode 100644 index 0000000..18ca3eb --- /dev/null +++ b/src/utf8.c @@ -0,0 +1,38 @@ +/* + * utf8.c: + * + * Copyright (c) 2008 James McKenzie , + * All rights reserved. + * + */ + +static char rcsid[] = "$Id$"; + +/* + * $Log$ + * Revision 1.1 2008/02/22 19:12:05 james + * *** empty log message *** + * + */ + +#include "project.h" + + + /*FIXME: for the moment we bodge utf8 support*/ + if ((ch>=0xc0) && (ch<0xe0)) /*Start of two byte unicode sequence*/ + { + p->in_utf8=2; + } else if ((ch>=0xe0) && (ch<0xf0)) /*Start of three byte unicode sequence*/ + { + p->in_utf8=3; + } else if ((ch>=0xf0) && (ch<0xf7)) /*Start of four byte unicode sequence*/ + p->in_utf8=4; + } + + if (p->utf_8) { + p->in_utf8--; + ch='?'; + } + + if (!p->utf_8) { + /*Not first or last byte in sequence*/ -- cgit v1.2.3