MCPcopy Index your code
hub / github.com/git/git / fallback_encoding

Function fallback_encoding

utf8.c:542–562  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

540}
541
542static 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
564char *reencode_string_len(const char *in, size_t insz,
565 const char *out_encoding, const char *in_encoding,

Callers 1

reencode_string_lenFunction · 0.85

Calls 1

is_encoding_utf8Function · 0.85

Tested by

no test coverage detected