Mail Archive Home | enhydra List | December 2004 Index
| <-- Date Index --> | <-- Thread Index --> |
Hi,
Thank you very much for your patch. We included your changes on DODS CVS.
Sinisa
----- Original Message -----
From: "Gilles Serasset" <Gilles.Serasset@xxxxxxx>
To: <dods@xxxxxxxxxxxxx>; <enhydra@xxxxxxxxxxxxx>
Sent: Tuesday, December 14, 2004 3:03 PM
Subject: [enhydra] DODS and accented characters
Dear all,
I'm currently using enhydra 5.1-16 (with dods 6.0) on a Mac.
We have problems using dods for our purpose, as we use French accents
in comments in the doml file.
The result is:
> [org.ejen.EjenException] {
> message: source
> {file=/Users/serasset/dev/papillon/Papillon5.1/build/
> Dods_Generated_Sources/dynamic/fr/imag/clips/papillon/data/
> VolumeEntry.xml}: bad source file:
> /Users/serasset/dev/papillon/Papillon5.1/build/Dods_Generated_Sources/
> dynamic/fr/imag/clips/papillon/data/VolumeEntry.xml
> [org.apache.xml.utils.WrappedRuntimeException: Invalid byte 1 of
> 1-byte UTF-8 sequence.]
> }
>
> [org.apache.xml.utils.WrappedRuntimeException] {
> message: Invalid byte 1 of 1-byte UTF-8 sequence.
> }
>
> [java.io.UTFDataFormatException] {
> message: Invalid byte 1 of 1-byte UTF-8 sequence.
> }
The problem comes from the fact that the generated transient xml file
(generated for each table) does not specify it's encoding, neither does
DODS specify correctly the encoding of the file (letting java use it's
default encoding).
The default encoding is not the same depending on the machine you use,
hence, these should be ALWAYS set by programs. Moreover, when
specified, the encoding used is iso-latin-1 which is not really a
correct choice for japanese/chinese/russian/... developpers.
I quickly patched the TransientXMLBuilderFactory.java file that creates
the tables.xml and XXX.xml files (xxx being the tablename). It solved
my problem and compilation succeed.
Patch is added at the end of this message. I did not check to see if
ejen has the same problem or not. Patch is generated against the last
CVS version of DODS6.
Thanks in advance,
Gilles,
Index:
modules/Generator/src/org/enhydra/dods/trans/
TransientXMLBuilderFactory.java
===================================================================
RCS file:
/cvsroot/dods/DODS6/modules/Generator/src/org/enhydra/dods/trans/
TransientXMLBuilderFactory.java,v
retrieving revision 1.1
diff -r1.1 TransientXMLBuilderFactory.java
645c645
< StringBuffer tablesBuff = new StringBuffer("<?xml
version=\"1.0\" encoding=\"iso-8859-1\"?>\n\n");
---
> StringBuffer tablesBuff = new StringBuffer("<?xml
version=\"1.0\" encoding=\"utf-8\"?>\n\n");
671c671
< StringBuffer xmlBuff = new StringBuffer();
---
> StringBuffer xmlBuff = new StringBuffer("<?xml
version=\"1.0\" encoding=\"utf-8\"?>\n\n");
889c889
< outStream.write(xmlBuff.toString().getBytes());
---
> outStream.write(xmlBuff.toString().getBytes("UTF-8"));
903c903
< outStream.write(tablesBuff.toString().getBytes());
---
> outStream.write(tablesBuff.toString().getBytes("UTF-8"));
916c916
< StringBuffer tablesBuff = new StringBuffer("<?xml
version=\"1.0\" encoding=\"iso-8859-1\"?>\n\n");
---
> StringBuffer tablesBuff = new StringBuffer("<?xml
version=\"1.0\" encoding=\"utf-8\"?>\n\n");
954c954
< outStream.write(tablesBuff.toString().getBytes());
---
> outStream.write(tablesBuff.toString().getBytes("UTF-8"));
967c967
< StringBuffer tablesBuff = new StringBuffer("<?xml
version=\"1.0\" encoding=\"iso-8859-1\"?>\n\n");
---
> StringBuffer tablesBuff = new StringBuffer("<?xml
version=\"1.0\" encoding=\"utf-8\"?>\n\n");
1002c1002
< outStream.write(tablesBuff.toString().getBytes());
---
> outStream.write(tablesBuff.toString().getBytes("UTF-8"));
--
Gilles Sérasset
GETA-CLIPS-IMAG (UJF, INPG & CNRS)
BP 53 - F-38041 Grenoble Cedex 9
Phone: +33 4 76 51 43 80
Fax: +33 4 76 44 66 75
----------------------------------------------------------------------------
----
>
> --
> You receive this message as a subscriber of the enhydra@xxxxxxxxxxxxx
mailing list.
> To unsubscribe: mailto:enhydra-unsubscribe@xxxxxxxxxxxxx
> For general help: mailto:sympa@xxxxxxxxxxxxx?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>
| <-- Date Index --> | <-- Thread Index --> |
Powered by MHonArc.
Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.