Please make txt2svg.pl cope with UTF-8 (patch included)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Medium
|
Reuben Thomas |
Bug Description
txt2svg.pl, used to import text files, can only cope with 7-bit ASCII: implicitly, its output is UTF-8 encoded, but it actually reads its input as 8-bit text, and re-encodes it on output (again, implicitly). Since the default encoding of the output SVG is UTF-8, anything other than 7-bit ASCII is mangled.
The following patch improves this by supporting UTF-8. Other 8-bit input is, as before, silently mangled. It uses the Encode module, which has been a part of standard Perl for many years. I've tested this script with Inkscape 0.48.3, and confirmed that the version of txt2svg.pl supplied there is the same as in current Bazaar.
--- /usr/share/
+++ /home/rrt/
@@ -4,8 +4,11 @@
use strict;
use SVG;
+use Encode;
use vars qw($VERSION);
-$VERSION = '1.00';
+$VERSION = '1.01';
+
+binmode(STDOUT, ":utf8");
my $svg = new SVG;
@@ -25,7 +28,7 @@
}
)
- ->cdata($_);
+ ->cdata(
$i++;
}
tags: | added: extensions-plugins |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Reproduced with Inkscape 0.48.3.1 and Inkscape 0.48+devel r11552 on OS X 10.7.4