git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@242 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-09 11:21:39 +00:00
parent cf8870ece7
commit 814e5ea011
4 changed files with 42 additions and 7 deletions

View File

@@ -74,3 +74,23 @@ int MwUTF8Length(const char* input) {
return len;
}
int MwUTF8Copy(const char* src, int srcskip, char* dst, int dstskip, int len){
int i;
int out;
int total = 0;
for(i = 0; i < srcskip; i++) src += MwUTF8ToUTF32(src, &out);
for(i = 0; i < dstskip; i++) dst += MwUTF8ToUTF32(dst, &out);
for(i = 0; i < len; i++){
int len = MwUTF8ToUTF32(src, &out);
memcpy(dst, src, len);
src += len;
dst += len;
total += len;
}
dst[total] = 0;
return total;
}