This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Encoding and unescaped-data



$LANG is an OS-specific way of telling Java which encoding to use, so I'm not surprised you run into trouble. What do you get when you run the following Kawa code in your Windows laptop?


(<java.lang.System>:getProperty "file.encoding")

If you have control over what arguments are passed to the Java process that's running your code, you may want to add a "- Dfile.encoding=UTF-8" argument.

Other questions:

1. How is the port that you're using to output the data being opened?

2. When are you setting the port-char-encoding, relative to when the port is being opened?

On Aug 22, 2007, at 2:39 PM, Daniel Terhorst wrote:

I tried running the code to my Linux machine and it actually worked
just fine over there, save that I needed to add <?xml version="1.0"
encoding="UTF-8"?> to the output file. The $LANG environment variable
was en_US.UTF-8.

Still no luck on my Windows laptop, however. I tried changing the LANG
system and user environment variables to en_US.UTF-8 and UTF-8, but
that didn't work. They were originally C.

I also tried setting the port-char-encoding in my example:

(set! port "UTF-8")
(set! port-char-encoding "UTF-8")

but that didn't seem to make a difference either.




On 8/22/07, Luis Casillas <casillas@mercedsystems.com> wrote:

Are you somewhere specifying that you want to output data in UTF-8? If no
output encoding is specified, Java will pick one based on your locale; if
that's not UTF-8, then unencodable characters will be output as "?". If you
are on a Unix variant, what's the value of your $LANG environment variable?


(I once ran into a problem where Kawa will not compile source files with
UTF-8 characters correctly if the locale wasn't set to be UTF-8; this is
probably related.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]