gnucash maint: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Fri Jun 28 14:51:13 EDT 2019
Updated via https://github.com/Gnucash/gnucash/commit/0543a290 (commit)
via https://github.com/Gnucash/gnucash/commit/38a3d62f (commit)
from https://github.com/Gnucash/gnucash/commit/a3871d9c (commit)
commit 0543a29012b18ac2e3bf2a6915f51d1c91b5cbcb
Merge: a3871d9ca 38a3d62f0
Author: John Ralls <jralls at ceridwen.us>
Date: Fri Jun 28 11:49:57 2019 -0700
Merge Dawid Wróbel's uft-8 obfuscation fix into maint.
commit 38a3d62f00e423d6eb47eb6c7b124c9320eca2b3
Author: Dawid Wróbel <me at dawidwrobel.com>
Date: Sun Jun 23 19:51:21 2019 -0400
Check and UTF8-encode the names if needed
Fixes the "Wide character in subroutine entry" error for some UTF8 entries
diff --git a/util/obfuscate.pl b/util/obfuscate.pl
index a0d2ecf69..e1e97ff71 100755
--- a/util/obfuscate.pl
+++ b/util/obfuscate.pl
@@ -6,6 +6,8 @@
use strict;
use warnings;
+use utf8;
+use Encode;
use Digest::MD5 qw(md5_hex);
use XML::DOM; # on ubuntu this requires 'libxml-dom-perl'
@@ -32,7 +34,8 @@ close DICT;
sub get_a_name {
my $scalar = shift;
return '' if !$scalar;
- my $index = hex substr(md5_hex($scalar),-$hex_digits);
+ my $scalar_encoded = utf8::is_utf8($scalar) ? Encode::encode_utf8($scalar) : $scalar;
+ my $index = hex substr(md5_hex($scalar_encoded),-$hex_digits);
my $result = $dict[$index];
chop $result;
return $result;
Summary of changes:
util/obfuscate.pl | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
More information about the gnucash-changes
mailing list