Skip to content

Instantly share code, notes, and snippets.

@Eugenetucha
Eugenetucha / utf8_encode.c
Created October 31, 2020 08:04 — forked from MightyPork/utf8_encode.c
C function to encode a Unicode code point as UTF-8 byte array
#include <stdint.h>
/**
* Encode a code point using UTF-8
*
* @author Ondřej Hruška <ondra@ondrovo.com>
* @license MIT
*
* @param out - output buffer (min 5 characters), will be 0-terminated
* @param utf - code point 0-0x10FFFF