| 155 | } |
| 156 | |
| 157 | int strbuf_reencode(struct strbuf *sb, const char *from, const char *to) |
| 158 | { |
| 159 | char *out; |
| 160 | size_t len; |
| 161 | |
| 162 | if (same_encoding(from, to)) |
| 163 | return 0; |
| 164 | |
| 165 | out = reencode_string_len(sb->buf, sb->len, to, from, &len); |
| 166 | if (!out) |
| 167 | return -1; |
| 168 | |
| 169 | strbuf_attach(sb, out, len, len + 1); |
| 170 | return 0; |
| 171 | } |
| 172 | |
| 173 | void strbuf_tolower(struct strbuf *sb) |
| 174 | { |
no test coverage detected