return the number of columns of string 's' in current locale */
| 130 | |
| 131 | /* return the number of columns of string 's' in current locale */ |
| 132 | int gettext_width(const char *s) |
| 133 | { |
| 134 | static int is_utf8 = -1; |
| 135 | if (is_utf8 == -1) |
| 136 | is_utf8 = is_utf8_locale(); |
| 137 | |
| 138 | return is_utf8 ? utf8_strwidth(s) : strlen(s); |
| 139 | } |
| 140 | #endif |
| 141 | |
| 142 | int is_utf8_locale(void) |
no test coverage detected