1 /* 2 * Copyright (c) 2009-2014 Petri Lehtinen <petri@digip.org> 3 * 4 * Jansson is free software; you can redistribute it and/or modify 5 * it under the terms of the MIT license. See LICENSE for details. 6 */ 7 8 #ifndef UTF_H 9 #define UTF_H 10 11 //#ifdef HAVE_CONFIG_H 12 #include <jansson_private_config.h> 13 //#endif 14 15 #ifdef HAVE_STDINT_H 16 #include <stdint.h> 17 #endif 18 19 int utf8_encode(int32_t codepoint, char *buffer, size_t *size); 20 21 size_t utf8_check_first(char byte); 22 size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint); 23 const char *utf8_iterate(const char *buffer, size_t size, int32_t *codepoint); 24 25 int utf8_check_string(const char *string, size_t length); 26 27 #endif 28