1 /*- 2 * The utf-8 module is derived from the utf-8 functions in 3 * git://git.suckless.org/sent 4 * 5 * ISC-License 6 * 7 * (c) 2014-2017 Markus Teich <markus.teich@stusta.mhn.de> 8 * 9 * Permission to use, copy, modify, and/or 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 * (c) 2016,2017 Laslo Hunhold <dev@frign.de> 22 * (c) 2016 ssd <ssd@mailless.org> 23 * (c) 2016 Hiltjo Posthuma <hiltjo@codemadness.org> 24 * (c) 2015 David Phillips <dbphillipsnz@gmail.com> 25 * (c) 2015 Grant Mathews <grant.m.mathews@gmail.com> 26 * (c) 2015 Dimitris Papastamos <sin@2f30.org> 27 * (c) 2015 Alexis <surryhill@gmail.com> 28 * (c) 2015 Quentin Rameau <quinq@fifth.space> 29 * (c) 2015 Ivan Tham <pickfire@riseup.net> 30 * (c) 2015 Jan Christoph Ebersbach <jceb@e-jc.de> 31 * (c) 2015 Tony Lainson <t.lainson@gmail.com> 32 * (c) 2015 Szabolcs Nagy <nsz@port70.net> 33 * (c) 2015 Jonas Jelten <jj@sft.mx> 34 */ 35 #pragma once 36 37 #define UTF_INVALID 0xFFFD 38 #define UTF_SIZE 4 39 40 size_t utf8_decode(const char *, size_t, uint32_t *); 41 size_t utf8_encode(uint32_t, char *); 42