MCPcopy Create free account
hub / github.com/crawl/crawl / utf8_validate

Function utf8_validate

crawl-ref/source/unicode.cc:200–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200static string utf8_validate(const char *s)
201{
202 string d;
203 char32_t c;
204 int l;
205
206 while ((l = utf8towc(&c, s)))
207 {
208 s += l;
209
210 char buf[4];
211 int r = wctoutf8(buf, c);
212 for (int i = 0; i < r; i++)
213 d.push_back(buf[i]);
214 }
215 return d;
216}
217
218string mb_to_utf8(const char *s)
219{

Callers 2

mb_to_utf8Function · 0.70
get_lineMethod · 0.70

Calls 3

utf8towcFunction · 0.85
wctoutf8Function · 0.85
push_backMethod · 0.45

Tested by

no test coverage detected