summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorLars Schneider <larsxschneider@gmail.com>2018-03-15 23:57:46 +0100
committerJunio C Hamano <gitster@pobox.com>2018-03-16 10:41:31 -0700
commitb4609890875360a7f63db68652a971a5ea1f9be4 (patch)
tree22c2330bc4a5834416dbb84d7771fe3d789cd4de /config.c
parentc1b7830e109b2a5a33ad10c9d82d330f9a6a6e17 (diff)
downloadgit-ls/checkout-encoding.tar.gz
convert: add round trip check based on 'core.checkRoundtripEncoding'ls/checkout-encoding
UTF supports lossless conversion round tripping and conversions between UTF and other encodings are mostly round trip safe as Unicode aims to be a superset of all other character encodings. However, certain encodings (e.g. SHIFT-JIS) are known to have round trip issues [1]. Add 'core.checkRoundtripEncoding', which contains a comma separated list of encodings, to define for what encodings Git should check the conversion round trip if they are used in the 'working-tree-encoding' attribute. Set SHIFT-JIS as default value for 'core.checkRoundtripEncoding'. [1] https://support.microsoft.com/en-us/help/170559/prb-conversion-problem-between-shift-jis-and-unicode Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'config.c')
-rw-r--r--config.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/config.c b/config.c
index 1f003fbb90..d0ada9fcd4 100644
--- a/config.c
+++ b/config.c
@@ -1172,6 +1172,11 @@ static int git_default_core_config(const char *var, const char *value)
return 0;
}
+ if (!strcmp(var, "core.checkroundtripencoding")) {
+ check_roundtrip_encoding = xstrdup(value);
+ return 0;
+ }
+
if (!strcmp(var, "core.notesref")) {
notes_ref_name = xstrdup(value);
return 0;