on 03-31-2009 11:49 AM
Hi,
I have a JAVA SAX mapping which is giving the following error for files containing characters of type £ :
");
Perhaps the above will override the File Encoding parameter set in the Sender File Adapter?
Any other ideas?
Che
Edited by: Che Eky on Mar 31, 2009 12:50 PM
I guess UTF-8 does not support "£" - but ISO-8859-1 or ISO-8859-2 will do.
Pls check the message types in IR and the encoding that's given there.
Regards,
Kai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This would be of your interest
https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
Regards,
Prateek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok I can solve the problem by making the following change in the JAVA mapping:
public void startDocument() throws SAXException {
// Build and output XML header
// write("<?xml version=\"1.0\" encoding=
"utf-8\"?>");
write("<?xml version=\"1.0\" encoding=\"windows-1252\"?>");
write(lineEnd);
}
As this JAVA mapping is used in many places does anyone know how the mapping can be rewritten to determine the required encoding format (based on the communication channel)????????
Che
>
> As this JAVA mapping is used in many places does anyone know how the mapping can be rewritten to determine the required encoding format (based on the communication channel)????????
>
> Che
if you meant you want to know in the mapping what is the encoding used in the file sender adapter, then you can easily determine this by using ASMA and dynamic configuration
in your case it will be FileEncoding
See http://help.sap.com/saphelp_nw04/helpdata/en/e3/94007075cae04f930cc4c034e411e1/content.htm -> Adapter-Specific Message Attributes
Also ref: /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name for sample codes ...
to use ASMA in Java mapping this will your reference;
http://help.sap.com/saphelp_nw04/helpdata/en/43/09b16006526e72e10000000a422035/content.htm
ex.
DynamicConfigurationKey key = DynamicConfigurationKey.create(
u201Chttp://sap.com/xi/XI/System/Fileu201D,
u201CFileEncodingu201D);
String myEncoding = conf.get(key);
myEncoding will now have the encoding set in the file adapter
Hi Kai,
1) What encoding does the incoming XMl has? UTF-8?
It has UTF-8 at the top of the xml file
2) Is the £ displayed correctly in the incoming message?
It has # when the file is uploaded using mode ASC for ACSII
It has £ when the file is uploaded using mode BIN for binary
3) What encoding have you defined for you incoming / outgoing message types (XSDs / DTDs)
In the Sender File Adapter I am using windows-1252
Che
Okay - thanks.
I wonder if this config would work:
1) Uploaded XML has ISO-8859-1 encoding in header.
2) XSD / DTD for message types in repository (used in the mapping - in & out) are set to produce XML with ISO encoding.
Is it possible to get rid of the JAVA part then? Not really sure, but came to my mind..
Regards,
Kai
2) Is the £ displayed correctly in the incoming message?
It has # when the file is uploaded using mode ASC for ACSII
It has £ when the file is uploaded using mode BIN for binar
In the sender file adapter channel, the file type binary must be used for any XML file. Do not put any encoding to the channel, as the file might be corrupted.
The encoding of XSD or WSDL does not influence the encoding of the content, so you need not care about this.
Regards
Stefan
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.