Return true if the current charset is UTF-8. */
| 186 | |
| 187 | /* Return true if the current charset is UTF-8. */ |
| 188 | static inline bool |
| 189 | is_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 |
no outgoing calls
no test coverage detected