MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxUTF8Length

Function fxUTF8Length

xs/sources/xsCommon.c:1048–1066  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1046}
1047
1048txSize fxUTF8Length(txInteger character)
1049{
1050 txSize length;
1051 if (character < 0)
1052 length = 0;
1053 else if (character == 0)
1054 length = 2;
1055 else if (character < 0x80)
1056 length = 1;
1057 else if (character < 0x800)
1058 length = 2;
1059 else if (character < 0x10000)
1060 length = 3;
1061 else if (character < 0x110000)
1062 length = 4;
1063 else
1064 length = 0;
1065 return length;
1066}
1067
1068#if mxCESU8
1069

Callers 1

fxCharSetStringsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected