UGDK
|
00001 /* 00002 * Copyright (c) 2007 Alexey Vatchenko <av@bsdua.org> 00003 * 00004 * Permission to use, copy, modify, and/or distribute this software for any 00005 * purpose with or without fee is hereby granted, provided that the above 00006 * copyright notice and this permission notice appear in all copies. 00007 * 00008 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 00009 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 00010 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 00011 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 00012 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 00013 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 00014 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00015 */ 00016 00017 /* 00018 * utf8: implementation of UTF-8 charset encoding (RFC3629). 00019 */ 00020 #ifndef _UTF8_H_ 00021 #define _UTF8_H_ 00022 00023 #include <sys/types.h> 00024 #include <wchar.h> 00025 00026 #define UTF8_IGNORE_ERROR 0x01 00027 #define UTF8_SKIP_BOM 0x02 00028 00029 size_t utf8_to_wchar(const char *in, size_t insize, wchar_t *out, 00030 size_t outsize, int flags); 00031 size_t wchar_to_utf8(const wchar_t *in, size_t insize, char *out, 00032 size_t outsize, int flags); 00033 00034 #endif /* !_UTF8_H_ */