libunic/char32size.c
2022-05-31 15:27:46 +03:00

12 lines
332 B
C

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