Compare commits

..

No commits in common. "master" and "v0.1.0" have entirely different histories.

View File

@ -3,14 +3,10 @@
#include "build.h" #include "build.h"
char16_t* tochar16_unicode(char16_t d[2], unsigned int uc) { char32_t* tochar32_unicode(char32_t d[1], unsigned int uc) {
if (uc <= 0xffff) { if (uc <= 0x10ffff && (uc < 0xd800 || uc > 0xdfff)) {
*(d++) = uc; *(d++) = uc;
} else if (uc <= 0x10ffff && (uc < 0xd800 || uc > 0xdfff)) { } else return 0;
uc -= 0x010000;
*(d++) = 0xd800 | (uc&0x0ffc00)>>10;
*(d++) = 0xdc00 | (uc&0x03ff);
} else d = 0;
return d; return d;
} }