| 540 | } |
| 541 | |
| 542 | static const char *fallback_encoding(const char *name) |
| 543 | { |
| 544 | /* |
| 545 | * Some platforms do not have the variously spelled variants of |
| 546 | * UTF-8, so let's fall back to trying the most official |
| 547 | * spelling. We do so only as a fallback in case the platform |
| 548 | * does understand the user's spelling, but not our official |
| 549 | * one. |
| 550 | */ |
| 551 | if (is_encoding_utf8(name)) |
| 552 | return "UTF-8"; |
| 553 | |
| 554 | /* |
| 555 | * Even though latin-1 is still seen in e-mail |
| 556 | * headers, some platforms only install ISO-8859-1. |
| 557 | */ |
| 558 | if (!strcasecmp(name, "latin-1")) |
| 559 | return "ISO-8859-1"; |
| 560 | |
| 561 | return name; |
| 562 | } |
| 563 | |
| 564 | char *reencode_string_len(const char *in, size_t insz, |
| 565 | const char *out_encoding, const char *in_encoding, |
no test coverage detected