Laxkit  0.0.7.1
utf8utils.h
Go to the documentation of this file.
1 /*
2  *
3  * This file is based in part on utf.c/utf.h from
4  * the FLTK project: http://www.fltk.org, with the following copyright.
5  * Further modifications to this file are subject to the same copyright.
6  *
7  * Copyright 1998-2006 by Bill Spitzak and others.
8  *
9  * Permission to use, copy, modify, and distribute this software for any
10  * purpose with or without fee is hereby granted, provided that the above
11  * copyright notice and this permission notice appear in all copies.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20  *
21  */
26 #ifndef _LAX_UTF8UTILS_H
27 #define _LAX_UTF8UTILS_H
28 
29 #include <stdlib.h>
30 
31 namespace Laxkit {
32 
33 int utf8bytes(unsigned ucs);
34 
35 unsigned utf8decode(const char*, const char* end, int* len);
36 int utf8encode(unsigned, char*);
37 const char* utf8fwd(const char*, const char* start, const char* end);
38 const char* utf8back(const char*, const char* start, const char* end);
39 
40 unsigned utf8towc(const char*, unsigned, wchar_t*, unsigned);
41 unsigned utf8tomb(const char*, unsigned, char*, unsigned);
42 unsigned utf8toa (const char*, unsigned, char*, unsigned);
43 unsigned utf8fromwc(char*, unsigned, const wchar_t*, unsigned);
44 unsigned utf8frommb(char*, unsigned, const char*, unsigned);
45 unsigned utf8froma (char*, unsigned, const char*, unsigned);
46 int utf8locale();
47 int utf8test(const char*, unsigned);
48 
49 } //namespace Laxkit
50 
51 
52 #endif
53 
54 

Mon Feb 17 2014 11:52:57, Laxkit