/*1* Copyright (c) 2007 Alexey Vatchenko <[email protected]>2*3* Permission to use, copy, modify, and/or distribute this software for any4* purpose with or without fee is hereby granted, provided that the above5* copyright notice and this permission notice appear in all copies.6*7* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES8* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF9* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR10* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES11* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN12* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF13* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.14*/1516/*17* utf8: implementation of UTF-8 charset encoding (RFC3629).18*/19#ifndef _UTF8_H_20#define _UTF8_H_2122#include <sys/types.h>2324#include <wchar.h>2526#define UTF8_IGNORE_ERROR 0x0127#define UTF8_SKIP_BOM 0x022829#ifdef __cplusplus30extern "C" {31#endif3233size_t utf8_to_wchar(const char *in, size_t insize, wchar_t *out,34size_t outsize, int flags);35size_t wchar_to_utf8(const wchar_t *in, size_t insize, char *out,36size_t outsize, int flags);3738#ifdef __cplusplus39}40#endif4142#endif /* !_UTF8_H_ */434445