We have a problem within our project
We have to conncurrent systems running. One Smalltalk-component and several other components implemented in Java. Communications is via synchronous webservices and/or via asynchronous database messages. Both communication utilize XML for the exchange of data. Between the systems we have agreed to use ISO-8859-1 encoding. The following XML structur is giving us real trouble, when trying to convert it to Smalltalk objects:
- Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<aprod.ermittelteAuszahlinfosFuerAuszahlidsUndDaten
xsi:schemaLocation="aprod.ermittelteAuszahinfosFuerAuszahlidsUndDaten.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<auszahlinfo>
<id>1000005648</id>
<gueltigam>2009-10-26</gueltigam>
<gueltigab>2009-10-01</gueltigab>
<gueltigbis>3000-12-31</gueltigbis>
<kassenoderkundennummer>0G11570</kassenoderkundennummer>
<auszahlkennzeichen>A</auszahlkennzeichen>
<empfaengername1>Finanzamt Idar-Oberstein</empfaengername1>
<kontonummer>7401507497</kontonummer>
<swiftcode>SOLADEST600</swiftcode>
<bankleitzahl>60050101</bankleitzahl>
<bankname>BW-Bank/LBBW Stuttgart</bankname>
<verwendungszweck2>09/225/1072/1-I/2</verwendungszweck2>
<bemerkung>GGR;01.10.2009;Abtretung €500,00 pro Abrechnung</bemerkung>
</auszahlinfo>
</aprod.ermittelteAuszahlinfosFuerAuszahlidsUndDaten>
The unicode entity € which is the €-sign is translated into a double byte character, which cannot be replaced in the out-string, which happens to be a single byte character string. So an Exception is thrown by String.
This raises the following questions:
1. Is it valid to use unicode entities in ISO-8859-1 encoded XML?
2. Should we just use another encoding scheme, or
3. Can the parser be configured so that unicode entities can indeed be used with ISO-8859-1 encoded XML?
Any help and/or suggestions are deeply appreciated,
Best regards
Uwe