[Po4a-commits] po4a/lib/Locale/Po4a TransTractor.pm,1.41,1.42
Jordi Vilalta
po4a-devel@lists.alioth.debian.org
Tue, 17 Aug 2004 22:38:53 +0000
Update of /cvsroot/po4a/po4a/lib/Locale/Po4a
In directory haydn:/tmp/cvs-serv13365/lib/Locale/Po4a
Modified Files:
TransTractor.pm
Log Message:
Say the reference to the first line with non-ascii encoding on error if it
couldn't determine the document encoding
Index: TransTractor.pm
===================================================================
RCS file: /cvsroot/po4a/po4a/lib/Locale/Po4a/TransTractor.pm,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- TransTractor.pm 16 Aug 2004 23:40:23 -0000 1.41
+++ TransTractor.pm 17 Aug 2004 22:38:51 -0000 1.42
@@ -378,6 +378,8 @@
if (!ref($decoder) or $decoder !~ /Encode::XS=/) {
# We have detected a non-ascii line
$self->{TT}{ascii_input} = 0;
+ # Save the reference for future error message
+ $self->{TT}{non_ascii_ref} ||= $ref;
}
}
}
@@ -809,7 +811,7 @@
} else {
# FYI, the document charset have to be determined *before* we see the first
# string to recode.
- die "po4a: ".dgettext("po4a","Couldn't determine the input document's character set. Please specify it on the command line.")."\n"
+ die "po4a: ".sprintf(dgettext("po4a","Couldn't determine the input document's character set. Please specify it on the command line. First non-ascii character appears in %s"),$self->{TT}{non_ascii_ref})."\n"
}
}