MCPcopy Create free account
hub / github.com/ZDoom/Raze / UnicodeToString

Function UnicodeToString

source/common/engine/serializer.cpp:105–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105const char *UnicodeToString(const char *cc)
106{
107 out.Resize((unsigned)strlen(cc) + 1);
108 int ndx = 0;
109 while (*cc != 0)
110 {
111 int size;
112 int c = utf8_decode((const uint8_t*)cc, &size);
113 if (c < 0 || c > 255) c = '?'; // This should never happen because all content was encoded with StringToUnicode which only produces code points 0-255.
114 out[ndx++] = c;
115 cc += size;
116 }
117 out[ndx] = 0;
118 return &out[0];
119}
120
121//==========================================================================
122//

Callers 2

serializer.cppFile · 0.85

Calls 2

utf8_decodeFunction · 0.85
ResizeMethod · 0.45

Tested by

no test coverage detected