[Bins] iconv issue with bins 1.1.27 on solaris 10

Bill Clarke llib at computer.org
Fri Jun 17 01:48:54 BST 2005


Martin Michlmayr wrote, On 06/17/05 10:34:
> * Bill Clarke <llib at computer.org> [2005-06-17 10:26]:
> 
>>646
>>$
>>
>>so that's no good, i think.
> 
> Google shows that refers to US-ASCII (ISO 646).  One link [0] says:
> 
> +  /* On Solaris the default encoding, as returned by nl_langinfo(),
> +     is `646' (aka ASCII), but the Solaris iconv_open() doesn't
> +     understand that, so we use the default value instead.  */
> 
> So how about:
[patch snipped]
> [0] http://gcc.gnu.org/ml/java/2002-03/msg00631.html

ok, that works for me.

here's the (fixed) patch (hopefully my mailer doesn't wrap the lines):
"""
--- bins.old    2005-06-17 10:40:11.349579000 +1000
+++ bins        2005-06-17 10:41:44.058954000 +1000
@@ -361,12 +361,17 @@
                                          # files.
 );

-my $localEncoding = `locale charmap`;
+my $codeset;
+eval {
+    require I18N::Langinfo;
+    I18N::Langinfo->import(qw(langinfo CODESET));
+    $codeset = langinfo(CODESET());
+};
 # ANSI is unspeakably primitive, keep LATIN1 instead
-if ($? == 0 && $localEncoding && ($localEncoding ne "ANSI_X3.4-1968")) {
-  chop($localEncoding);
-  $defaultConfig{defaultEncoding} = $localEncoding;
-  beVerboseN("Forcing encoding to $localEncoding", 2);
+# Solaris refers to ISO 646 as "646" but that is not a valid codeset
+if (!$@ && $codeset && $codeset ne "ANSI_X3.4-1968" && $codeset != 646) {
+  $defaultConfig{defaultEncoding} = $codeset;
+  beVerboseN("Forcing encoding to $codeset", 2);
 }
 my $local2htmlConverter;
 $local2htmlConverter = Text::Iconv->new($defaultConfig{defaultEncoding},
"""

cheers,
/lib
-- 
/lib BillClarke PostdoctoralFellow CompSci ANU cs.anu.edu.au/CC-NUMA
http://llib.cjb.net llib at computer.org  tel:+61-2-6125x5687 fax:x0010
PGPid:B381EE7DB7D3E58F17248C672E2DA124ADADF444 GNU unix LaTeX XPilot
Buffy DrWho Goodies StarTrek XFiles Origami SML SMP MPI mozilla tcsh
Asimov Bear Clarke Donaldson Volleyball Ultimate Cricket emacs C++ X
Jordan Kay Lackey Martin Stasheff DeepPurple H&C KLF Queen PinkFloyd


More information about the Bins mailing list