From jan@swi.psy.uva.nl  Sun Dec 10 14:03:39 2000
Received: from gollem.swi.psy.uva.nl (gollem [145.18.152.30])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id OAA27645;
	Sun, 10 Dec 2000 14:03:38 +0100 (MET)
Received: (from jan@localhost)
	by gollem.swi.psy.uva.nl (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) id OAA21993;
	Sun, 10 Dec 2000 14:01:10 +0100
Date: Sun, 10 Dec 2000 14:01:10 +0100
Message-Id: <200012101301.OAA21993@gollem.swi.psy.uva.nl>
From: Jan Wielemaker <jan@swi.psy.uva.nl>
Subject: Re: swi jpl character coding
To: fadushin@syr.edu,
        Recipients of SWI-Prolog Mailing List <prolog@swi.psy.uva.nl>
In-Reply-To: Fred Dushin's message of Thu, 7 Dec 2000 15:01:34 -0500 (EST)
Phone: +31 - 20 - 525 6121
Cc: jpl-user@lists.sourceforge.net

> > Hi,
> > 
> > i use jpl-1.0.1 together with 3.4.2. In my Prolog Demo i use some
> > german "Umlaute" like ÄÖÜöäüß.
> > All these characters are mapped to ASCII 128 on the Java side.
> > 
> > What can i do?
> 
> Are you using umlautes in atoms or strings?  And I assume this is in
> your Prolog code, yes?
> 
> Converting from Prolog to Java, a char array is obtained from
> the FLI PL_get_atom_chars function, which returns char *, which in turn
> is converted to a Java String using NewStringUTF.
> 
> I guess I see two opportunities for things to go awry; either the
> PL_get_atom_chars is just returning the high order byte of the umluate
> char, or the NewStringUTF is not respecting the UTF encoding.
> 
> Jan, how are atoms encoded in the prolog vm?  As UTF?

No.  As yet it is encoded as an unsigned char * with length, so it can
contain 0-bytes.  So it cannot represent characters outside the range
0..255, which you can use with any 8-bit encoding for which the lower
128 characters match the ASCII set.  It is planned to change this to
use UTF-8, probably somewhere next year.

	Cheers --- Jan

