View Single Post

  #2 (permalink)  
Old 09-01-2005
Tim
 
Posts: n/a
Default Re: problem with java, ASCII and Linux

On Thu, 01 Sep 2005 02:40:14 -0700, fcastillo sent:

> I has a problem with ASCII , for example : ..........
> import java.io.*;
>
>
> public class HolaMundo
> {
> public static void main (String[] args) {
> System.out.println("Holá Múndo");
> }
> }
> ..........
>
> this programs runs ok on my windows jdk so it prints "Holá Múndo", but
> when i run the same HolaMundo.class program on my linux redhat it prints
> "Holá Múndo"
>
> I think the problem is with the ASCII table that uses the linux version of
> jre, but i dont know how to solve this problem. I need a Spanish-European
> ASCII table on my application but i think it is working with a US-ASCII
> table.
>
> Then i has installed a kaffe 1.0 (rpm) java machie on this linux and this
> solve the problem but i has another problems of compatibility with this
> old version of java kaffe.
>
> Do you know whats happening?


You're right that it's a character set issue, but how you go about
resolving it is something I don't know for your particular case.

When serving webpages, you configure things so that the webserver
explicitly describes the encoding scheme being used with the page (whether
that being setting the server configuration, or authoring the pages to
suit the server configuration).

You'll have to find out what your implementation of Java expects, and
tailor your data to suit; or what it can accept, and configure everything
in a suitable manner.

Specifying an encoding scheme with Apache is simple enough, just putting
a line like this in the configuration file, if you were using utf-8
encoded HTML pages:

AddDefaultCharset utf-8

Then, if you were using Java to include utf-8 into an utf-8 page, all
ought to be fine.

It seems, to me, that it's Java that you need to be checking up on.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please destroy some files yourself.