chiark / gitweb /
*** empty log message ***
[sympathy.git] / src / utf8.c
1 /*
2  * utf8.c:
3  *
4  * Copyright (c) 2008 James McKenzie <james@fishsoup.dhs.org>,
5  * All rights reserved.
6  *
7  */
8
9 static char rcsid[] = "$Id$";
10
11 /*
12  * $Log$
13  * Revision 1.1  2008/02/22 19:12:05  james
14  * *** empty log message ***
15  *
16  */
17
18 #include "project.h"
19
20
21   /*FIXME: for the moment we bodge utf8 support*/
22   if ((ch>=0xc0) && (ch<0xe0)) /*Start of two byte unicode sequence*/
23   {
24         p->in_utf8=2;
25   } else if ((ch>=0xe0) && (ch<0xf0)) /*Start of three byte unicode sequence*/
26   {
27         p->in_utf8=3;
28   } else if ((ch>=0xf0) && (ch<0xf7)) /*Start of four byte unicode sequence*/
29         p->in_utf8=4;
30   }
31
32   if (p->utf_8) {
33         p->in_utf8--;
34         ch='?';
35   }  
36
37   if (!p->utf_8)  {
38         /*Not first or last byte in sequence*/