mirror of
https://github.com/NeoFlock/neonucleus.git
synced 2025-09-24 09:03:32 +02:00
commit
24b47074eb
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
.zig-cache/
|
||||
zig-out/
|
||||
!data/.gitkeep
|
||||
.vscode/
|
||||
|
@ -8,7 +8,6 @@ static bool nn_unicode_is_continuation(unsigned char byte) {
|
||||
}
|
||||
|
||||
bool nn_unicode_validate(const char *b) {
|
||||
// TODO: validate UTF-8-ness
|
||||
const unsigned char* s = (const unsigned char*)b;
|
||||
while (*s) {
|
||||
if(s[0] <= 0x7F) {
|
||||
@ -168,12 +167,24 @@ const char *nn_unicode_codepointToChar(unsigned int codepoint, size_t *len) {
|
||||
return buffer;
|
||||
}
|
||||
|
||||
size_t nn_unicode_charWidth(unsigned int codepoint) {
|
||||
// TODO: implement this
|
||||
return 1;
|
||||
}
|
||||
|
||||
size_t nn_unicode_wlen(const char *s) {
|
||||
size_t wlen = 0;
|
||||
while (*s) {
|
||||
unsigned int codepoint = nn_unicode_codepointAt(s, 0);
|
||||
size_t codepointSize = nn_unicode_codepointSize(codepoint);
|
||||
wlen += nn_unicode_charWidth(codepoint);
|
||||
s += codepointSize;
|
||||
}
|
||||
return wlen;
|
||||
}
|
||||
|
||||
// NOT IMPLEMENTED YET
|
||||
|
||||
size_t nn_unicode_charWidth(unsigned int codepoint);
|
||||
|
||||
size_t nn_unicode_wlen(const char *s);
|
||||
|
||||
unsigned int nn_unicode_upperCodepoint(unsigned int codepoint);
|
||||
char *nn_unicode_upper(const char *s);
|
||||
unsigned int nn_unicode_lowerCodepoint(unsigned int codepoint);
|
||||
|
Loading…
x
Reference in New Issue
Block a user