MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / UTF8EncodeAdvance

Function UTF8EncodeAdvance

src/String.cpp:122–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122static void UTF8EncodeAdvance(char * &ioPtr,int c)
123{
124 if( c <= 0x7F )
125 *ioPtr++ = (c);
126 else if( c <= 0x7FF )
127 {
128 *ioPtr++ = ( 0xC0 | (c >> 6) );
129 *ioPtr++ = ( 0x80 | (c & 63) );
130 }
131 else if( c <= 0xFFFF )
132 {
133 *ioPtr++ = ( 0xE0 | (c >> 12) );
134 *ioPtr++ = ( 0x80 | ((c >> 6) & 63) );
135 *ioPtr++ = ( 0x80 | (c & 63) );
136 }
137 else
138 {
139 *ioPtr++ = ( 0xF0 | (c >> 18) );
140 *ioPtr++ = ( 0x80 | ((c >> 12) & 63) );
141 *ioPtr++ = ( 0x80 | ((c >> 6) & 63) );
142 *ioPtr++ = ( 0x80 | (c & 63) );
143 }
144}
145
146static unsigned char *sUtf8LenArray = 0;
147

Callers 4

TConvertToUTF8Function · 0.85
fromCharCodeMethod · 0.85
utf8_strMethod · 0.85
__bootMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected