| 80 | } |
| 81 | |
| 82 | static void init_gettext_charset(const char *domain) |
| 83 | { |
| 84 | charset = locale_charset(); |
| 85 | bind_textdomain_codeset(domain, charset); |
| 86 | |
| 87 | /* |
| 88 | * Work around an old bug fixed in glibc 2.17 (released on |
| 89 | * 2012-12-24), at the cost of potentially making translated |
| 90 | * messages from external functions like perror() emitted in |
| 91 | * the wrong encoding. |
| 92 | * |
| 93 | * The bug affected e.g. git.git's own 7eb93c89651 ([PATCH] |
| 94 | * Simplify git script, 2005-09-07), which is the origin of |
| 95 | * the "David_K\345gedal" test string. |
| 96 | * |
| 97 | * See a much longer comment added to this file in 5e9637c6297 |
| 98 | * (i18n: add infrastructure for translating Git with gettext, |
| 99 | * 2011-11-18) for more details. |
| 100 | */ |
| 101 | if (test_vsnprintf("%.*s", 13, "David_K\345gedal") < 0) |
| 102 | setlocale(LC_CTYPE, "C"); |
| 103 | } |
| 104 | |
| 105 | int git_gettext_enabled = 0; |
| 106 |
no test coverage detected