1 Reply Latest reply on Jan 11, 2004 1:52 AM by Stjepan Brbot

    What is RMI's default charset?

    Thomas Phan Newbie

      Note that ISO-8859-1 is the default charset most browsers used to encode a GET/POST query. what about RMI?

      For UTF-8 characters (in particular, characters other than ASCII, e.g. Chinese), I cannot see the same encoding after I transfered a Java character (or String) via RMI (i.e. between Tomcat and JBoss in different VMs)

      What byte sequence, and charset should I use, so that I can see the same Java string on both ends?

      p.s. In Java's theory, this should be handled by the stubs automatically, as long as it's an valid Java unicode character. However, I find that the JBoss 3 beta 2 stub doesn't handle this correctly. Is there a work around, e.g. using "new String(s.getBytes("UTF-8"), "ISO-8859-1")" to convert my UTF-8 String to ISO-8859-1 before making the remote call, and convert the charset back on the other end <- I assumed that ISO-8859-1 is the default charset for JBoss' RMI in this e.g.

        • 1. Re: What is RMI's default charset?
          Stjepan Brbot Newbie

           

          "twhphan" wrote:
          Note that ISO-8859-1 is the default charset most browsers used to encode a GET/POST query. what about RMI?


          In forms browser uses the character set you define in META tag inside header of your HTML document:
          <META http-equiv="Content-Type" content="text/html; charset=windows-1250">

          or in page declaration instruction of your JSP pages:
          <%@ page language="java" contentType="text/html; charset=windows-1250" %>

          In my case, for example, you can see that it is defined for browser to use windows-1250 charset. Unfortunately Java code cannot deal with this character set. Java code can work with character set called Cp1250 but there's not perfect matching among them and I don't know how to define this character set mappings among them for JBoss! I know how to do that for WebLogic but not for JBoss!