Revision 4c19594d
Von Moritz Bunkus vor etwa 14 Jahren hinzugefügt
SL/Template/OpenDocument.pm | ||
---|---|---|
3 | 3 |
use parent qw(SL::Template::Simple); |
4 | 4 |
|
5 | 5 |
use Archive::Zip; |
6 |
use Encode; |
|
6 | 7 |
use POSIX 'setsid'; |
7 | 8 |
|
8 | 9 |
use SL::Iconv; |
... | ... | |
228 | 229 |
return 0; |
229 | 230 |
} |
230 | 231 |
|
231 |
my $contents = $zip->contents("content.xml");
|
|
232 |
my $contents = Encode::decode('utf-8-strict', $zip->contents("content.xml"));
|
|
232 | 233 |
if (!$contents) { |
233 | 234 |
$self->{"error"} = "File is not a OpenDocument file."; |
234 | 235 |
$main::lxdebug->leave_sub(); |
... | ... | |
267 | 268 |
|
268 | 269 |
# $new_contents =~ s|>|>\n|g; |
269 | 270 |
|
270 |
$zip->contents("content.xml", $new_contents);
|
|
271 |
$zip->contents("content.xml", Encode::encode('utf-8-strict', $new_contents));
|
|
271 | 272 |
|
272 | 273 |
my $styles = $zip->contents("styles.xml"); |
273 | 274 |
if ($contents) { |
Auch abrufbar als: Unified diff
ZIP-Inhalt von und nach internes Encoding wandeln