MCPcopy Create free account
hub / github.com/coreutils/coreutils / is_utf8_charset

Function is_utf8_charset

src/system.h:188–199  ·  view source on GitHub ↗

Return true if the current charset is UTF-8. */

Source from the content-addressed store, hash-verified

186
187/* Return true if the current charset is UTF-8. */
188static inline bool
189is_utf8_charset (void)
190{
191 static int is_utf8 = -1;
192 if (is_utf8 == -1)
193 {
194 char32_t w;
195 mbstate_t mbs; mbszero (&mbs);
196 is_utf8 = mbrtoc32 (&w, "\xe2\x9f\xb8", 3, &mbs) == 3 && w == 0x27F8;
197 }
198 return is_utf8;
199}
200
201#include <locale.h>
202

Callers 2

mbsmbchrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected