libunic/tochar32_unicode.c

13 lines
338 B
C

/* This software is licensed by the MIT License, see LICENSE file */
/* Copyright © 2022 Gregory Lirent */
#include "build.h"
char32_t* tochar32_unicode(char32_t d[1], unsigned int uc) {
if (uc <= 0x10ffff && (uc < 0xd800 || uc > 0xdfff)) {
*(d++) = uc;
} else return 0;
return d;
}