From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17642 invoked by alias); 25 Apr 2002 08:26:11 -0000 Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org Received: (qmail 17627 invoked from network); 25 Apr 2002 08:26:09 -0000 Received: from unknown (HELO mail.certus.dk) (62.242.162.2) by sources.redhat.com with SMTP; 25 Apr 2002 08:26:09 -0000 Received: from localhost.localdomain ([192.168.2.117]) by mail.certus.dk with Microsoft SMTPSVC(5.0.2195.4453); Thu, 25 Apr 2002 10:26:08 +0200 Subject: Re: outputting iso-8859-1 chars From: Morten Poulsen To: tromey@redhat.com Cc: java@gcc.gnu.org In-Reply-To: <874ri066pw.fsf@creche.redhat.com> References: <1019683994.8904.26.camel@marvin> <874ri066pw.fsf@creche.redhat.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Thu, 25 Apr 2002 02:00:00 -0000 Message-Id: <1019723168.14529.17.camel@prefect> Mime-Version: 1.0 X-OriginalArrivalTime: 25 Apr 2002 08:26:08.0363 (UTC) FILETIME=[D97073B0:01C1EC32] X-SW-Source: 2002-04/txt/msg00354.txt.bz2 On Thu, 2002-04-25 at 01:02, Tom Tromey wrote: > You don't say what platform you're on. I assume you're on Linux. Yes, Linux 2.4.14 on a PIII and a 7400. > On Linux the Sun JVM assumes that the C locale uses ISO-8859-1, when > in fact it uses ASCII. libgcj respects this difference and outputs > just ASCII, meaning that character > 0x7f is printed as `?'. When I set my locale to da it still outouts a '?'. > FYI, `gcj --encoding' tells gcj the encoding of your .java file. it > doesn't affect the runtime behavior of your program (well, it can, > since a given sequence of bytes in the input file can have a different > meaning). If I don't use it, I get Hello.java:4: unrecognized character in input stream. even for ISO-8859-1 characters in comments. > Your problem is almost certainly on the printing end of things. Try > setting your locale to something that uses ISO-8859-1. Or try using > `new OutputStreamWriter (System.out, "ISO-8859-1")' Thanks, that fixed it. I had the same problem when writing danish characters to a socket. Inserting the above code fixed it there too. Thanks for the help, Morten -- Morten Poulsen http://www.afdelingp.dk/