diff --git a/debian/patches/quoted-config-opts-fix.dpatch b/debian/patches/quoted-config-opts-fix.dpatch
--- /dev/null
@@ -0,0 +1,27 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## quoted-config-opts-fix.dpatch by Sebastian Harl <sh@tokkee.org>
+##
+## DP: Fix handling of quoted strings in the config file
+## DP:
+## DP: parse_string() adapts the string length to automatically remove quotation
+## DP: marks when copying the string. However, when calling string_ncopy_do()
+## DP: strlen(arg) used to be called again instead of using the adapted value.
+## DP:
+## DP: This e.g. led to wrong locale settings when using
+## DP: set commit-encoding = "UTF-8"
+## DP: and thus a slightly messed up display.
+## DP:
+## DP: Thanks to Gerfried Fuchs for reporting this.
+
+diff a/tig.c b/tig.c
+--- a/tig.c
++++ b/tig.c
+@@ -1519,7 +1519,7 @@ option_set_command(int argc, const char *argv[])
+ }
+ arg += 1; arglen -= 2;
+ default:
+- string_ncopy(opt_encoding, arg, strlen(arg));
++ string_ncopy(opt_encoding, arg, arglen);
+ return OK;
+ }
+ }