diff options
author | james <> | 2008-02-22 19:12:05 +0000 |
---|---|---|
committer | james <> | 2008-02-22 19:12:05 +0000 |
commit | 22301df1f4af5937bf96cb85091d5220d206d9bc (patch) | |
tree | 71020082ddea0c28f6b754778f6b0133b3a0daff /src/utf8.c | |
parent | a7a1526ef4fed8460a87713fac159cc714bfde77 (diff) | |
download | sympathy-22301df1f4af5937bf96cb85091d5220d206d9bc.tar.gz sympathy-22301df1f4af5937bf96cb85091d5220d206d9bc.tar.bz2 sympathy-22301df1f4af5937bf96cb85091d5220d206d9bc.zip |
*** empty log message ***
Diffstat (limited to 'src/utf8.c')
-rw-r--r-- | src/utf8.c | 38 |
1 files changed, 38 insertions, 0 deletions
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 <james@fishsoup.dhs.org>, + * 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*/ |