You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Lawrence Jones <lj...@bea.com> on 2003/10/06 19:26:55 UTC

Patch Submission

Hi Dave
 
Patch Submission Description:
 
During compilation of .xsd files we generate .xsb files which are included in the generated jar. In some cases the names of these files are generated by getting the bytes of the String name of e.g. the Element in question and converting those bytes to characters of the form _xx where x is a hex character. We were using getBytes() without any arguments to get the bytes from the String passed in. This gets the bytes according to the platform-default character encoding. If you then attempt to find that .xsb file on a platform with a different default encoding starting from the same Element name (e.g. because you've deployed the application of which this jar is a part on a different platform), then the bytes which you get are different and the find attempt fails. I've now changed this so that we do a getBytes("UTF-8") on both the generation and consumption side. Also found a number of other places where getBytes() was in use. I either changed them to use getBytes("UTF-8") or found a different way to achieve the functionality without calling getBytes() at all.
 
The diff file is attached.
 
Cheers,
 
Lawrence
 
 

Re: Patch Submission

Posted by David Bau <da...@bea.com>.
Looks good to me.  Thank again for this cleanup Lawrence.

Will get it checked in soon.

David
----- Original Message ----- 
From: Lawrence Jones
To: David Bau
Cc: xmlbeans-dev@xml.apache.org
Sent: Monday, October 06, 2003 1:26 PM
Subject: Patch Submission


Hi Dave

Patch Submission Description:

During compilation of .xsd files we generate .xsb files which are included
in the generated jar. In some cases the names of these files are generated
by getting the bytes of the String name of e.g. the Element in question and
converting those bytes to characters of the form _xx where x is a hex
character. We were using getBytes() without any arguments to get the bytes
from the String passed in. This gets the bytes according to the
platform-default character encoding. If you then attempt to find that .xsb
file on a platform with a different default encoding starting from the same
Element name (e.g. because you've deployed the application of which this jar
is a part on a different platform), then the bytes which you get are
different and the find attempt fails. I've now changed this so that we do a
getBytes("UTF-8") on both the generation and consumption side. Also found a
number of other places where getBytes() was in use. I either changed them to
use getBytes("UTF-8") or found a different way to achieve the functionality
without calling getBytes() at all.

The diff file is attached.

Cheers,

Lawrence





- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Re: Patch Submission

Posted by David Bau <da...@bea.com>.
Looks good to me.  Thank again for this cleanup Lawrence.

Will get it checked in soon.

David
----- Original Message ----- 
From: Lawrence Jones
To: David Bau
Cc: xmlbeans-dev@xml.apache.org
Sent: Monday, October 06, 2003 1:26 PM
Subject: Patch Submission


Hi Dave

Patch Submission Description:

During compilation of .xsd files we generate .xsb files which are included
in the generated jar. In some cases the names of these files are generated
by getting the bytes of the String name of e.g. the Element in question and
converting those bytes to characters of the form _xx where x is a hex
character. We were using getBytes() without any arguments to get the bytes
from the String passed in. This gets the bytes according to the
platform-default character encoding. If you then attempt to find that .xsb
file on a platform with a different default encoding starting from the same
Element name (e.g. because you've deployed the application of which this jar
is a part on a different platform), then the bytes which you get are
different and the find attempt fails. I've now changed this so that we do a
getBytes("UTF-8") on both the generation and consumption side. Also found a
number of other places where getBytes() was in use. I either changed them to
use getBytes("UTF-8") or found a different way to achieve the functionality
without calling getBytes() at all.

The diff file is attached.

Cheers,

Lawrence





- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-dev-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/