Skip Menu |

This queue is for tickets about the Win32-InstallShield CPAN distribution.

Report information
The Basics
Id: 71736
Status: resolved
Priority: 0/
Queue: Win32-InstallShield

People
Owner: kbaucom [...] schizoid.com
Requestors: Torsten.Werner [...] assyst.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Problem with non ASCII characters in ism file
Date: Mon, 17 Oct 2011 14:24:21 +0200
To: bug-Win32-InstallShield [...] rt.cpan.org
From: Torsten.Werner [...] assyst.de
Hi, the information to reproduce the bug: Version of Win32::InstallShield: 0.5 Perl Version: This is perl, v5.10.1 built for MSWin32-x86-multi-thread OS. Windows 7 prof. German InstallShield: InstallShield 2011 Hotfix A The problem: The ism file contains per default the following line in the ISString table: <row><td>IDS_SETUPEXE_EXPIRE_MSG</td><td>1031</td><td>Diese Setup ist gültig bis %s. Das Setup wird nun beendet.</td><td>0</td><td/><td/></row> in hex: 017ba60: 2f74 643e 3c2f 726f 773e 0d0a 0909 3c72 /td></row>....<r 017ba70: 6f77 3e3c 7464 3e49 4453 5f53 4554 5550 ow><td>IDS_SETUP 017ba80: 4558 455f 4558 5049 5245 5f4d 5347 3c2f EXE_EXPIRE_MSG</ 017ba90: 7464 3e3c 7464 3e31 3033 313c 2f74 643e td><td>1031</td> 017baa0: 3c74 643e 4469 6573 6520 5365 7475 7020 <td>Diese Setup 017bab0: 6973 7420 67c3 bc6c 7469 6720 6269 7320 ist g..ltig bis 017bac0: 2573 2e20 2044 6173 2053 6574 7570 2077 %s. Das Setup w 017bad0: 6972 6420 6e75 6e20 6265 656e 6465 742e ird nun beendet. 017bae0: 3c2f 7464 3e3c 7464 3e30 3c2f 7464 3e3c </td><td>0</td>< 017baf0: 7464 2f3e 3c74 642f 3e3c 2f72 6f77 3e0d td/><td/></row>. 017bb00: 0a09 093c 726f 773e 3c74 643e 4944 535f ...<row><td>IDS_ There are 2 bytes to be seen for the "LATIN SMALL LETTER U WITH DIAERESIS" (code point 00FC in Unicode charts, c3bc in utf-8). After saving of the file with a modification of a different enry in the ISString table the text has been changed: 017ba70: 6f77 3e3c 7464 3e49 4453 5f53 4554 5550 ow><td>IDS_SETUP 017ba80: 4558 455f 4558 5049 5245 5f4d 5347 3c2f EXE_EXPIRE_MSG</ 017ba90: 7464 3e3c 7464 3e31 3033 313c 2f74 643e td><td>1031</td> 017baa0: 3c74 643e 4469 6573 6520 5365 7475 7020 <td>Diese Setup 017bab0: 6973 7420 67fc 6c74 6967 2062 6973 2025 ist g.ltig bis % 017bac0: 732e 2020 4461 7320 5365 7475 7020 7769 s. Das Setup wi 017bad0: 7264 206e 756e 2062 6565 6e64 6574 2e3c rd nun beendet.< 017bae0: 2f74 643e 3c74 643e 303c 2f74 643e 3c74 /td><td>0</td><t 017baf0: 642f 3e3c 7464 2f3e 3c2f 726f 773e 0d0a d/><td/></row>.. 017bb00: 0909 3c72 6f77 3e3c 7464 3e49 4453 5f53 ..<row><td>IDS_S The critical character is now encoded with "FC" (perl internal encoding) Neither InstallShield nor Win32::InstallShield can load this file. So far as I can see the problem is the save routine. When a section is parsed, the content is available in perl internal encoding. When the section is not parsed, the content has the original format. It is needed to encode the content for the parsed sections. In the sample I encode according the XML header. It works for me: sub save { local $_; my ($self) = @_; my $text = ''; my $encoding; foreach (@{$self->{sections}->{header}}) { $encoding=$1 if (/\sencoding="([^"]+)"/); } foreach my $section (@{$self->{'order'}}) { if($self->{'parsed'}{$section}) { # the table has been (possibly) modified, so rebuild it if($section eq 'summary') { $text .= defined($encoding) ? encode($encoding,$self->_save_summary) : $self->_save_summary; } else { $text .= defined($encoding) ? encode($encoding,$self->_save_table($section)) : $self->_save_table($section); } } else { # when the last table gets modified, we end up with an # extra newline if($section eq 'trailer') { $text =~ s/\n\n$/\n/; } # section wasn't touched, just spit out the stored text $text .= join("\n", @{$self->{'sections'}{$section}}) . "\n"; } } return $text; } Bye Torsten ---------------------------------------------------------------------- assyst GmbH Dr. Ing. Torsten Werner Product Manager plan.assyst Max-Planck-Str. 3 85609 Aschheim-Dornach Germany Phone: +49 (0)89 90505-0 Fax: +49 (0)89 90505-271 E-Mail: torsten.werner@assyst.de Internet: http://www.assyst.de Geschäftsführer: Dr. Andreas Seidl Eingetragen beim Registergericht München HRB 180174 Sitz der Gesellschaft: 85609 Aschheim-Dornach ----------------------------------------------------------------------
Fixed in version 0.6. Thanks!