diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-03-23 14:17:14 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-04 11:10:19 +0200 |
commit | f207ae9c7010b04f8a10554a3c9b62991fe51247 (patch) | |
tree | ca680f409996b7c602f8f722b7d85ebfcf1796d2 | |
parent | 74362ac38814872d49de9d5ae32e7e61ae04a544 (diff) |
tdf#116581: also read UTF16-encoded version string from TTF
Change-Id: I47d8a755450b085be39346615f06cee4f920859f
Reviewed-on: https://gerrit.libreoffice.org/51781
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 2367557493c216be5b5e8156ba6493d440a10b0f)
Reviewed-on: https://gerrit.libreoffice.org/52327
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | solenv/bin/modules/installer/windows/file.pm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/solenv/bin/modules/installer/windows/file.pm b/solenv/bin/modules/installer/windows/file.pm index 1a12becb6076..b8176a54794c 100644 --- a/solenv/bin/modules/installer/windows/file.pm +++ b/solenv/bin/modules/installer/windows/file.pm @@ -560,12 +560,20 @@ sub get_fileversion close TTF; my $ttfversion = "(Version )([0-9]+[.]*([0-9][.])*[0-9]+)"; + # UTF16-encoded version string + my $ttfversionU = "(V\0e\0r\0s\0i\0o\0n\0 \0)(([0-9]\0)+([.]\0([0-9]\0)+)*)"; if ($ttfdata =~ /$ttfversion/ms) { my ($version, $subversion, $microversion, $vervariant) = split(/\./,$2); $fileversion = int($version) . "." . int($subversion) . "." . int($microversion) . "." . int($vervariant); } + elsif ($ttfdata =~ /$ttfversionU/ms) + { + my $verfound = $2 + my ($version, $subversion, $microversion, $vervariant) = split(/\./,$verfound =~ s/\0//g); + $fileversion = int($version) . "." . int($subversion) . "." . int($microversion) . "." . int($vervariant); + } else { $fileversion = "1.0.0.0"; |