blob: ea226c3b8b5a736e837190eea3129891afcfb800 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
$NetBSD: patch-ab,v 1.5 2002/09/25 00:28:27 wiz Exp $
no 'locale' command on netbsd so deal with `locale charmap` not returning
correctly.
--- bins_edit.orig Sat Sep 21 09:50:14 2002
+++ bins_edit
@@ -42,12 +42,18 @@ use HTML::Entities;
my $verbose = 1;
my $html=0;
-my $localEncoding = `locale charmap`;
-chop($localEncoding);
+my $localEncoding;
+$localEncoding = `locale charmap`;
+if ($? != 0 ) {
+ $localEncoding = "LATIN1";
+}
+else {
if (! $localEncoding or ($localEncoding eq "ANSI_X3.4-1968")) {
+ chop($localEncoding);
# ANSI is unspeakably primitive, promote it.
$localEncoding = "LATIN1";
print "Forcing encoding to $localEncoding\n" if ($verbose >=2);
+}
}
my $converter = Text::Iconv->new($localEncoding, "UTF-8");
|