on 08-04-2010 2:28 PM
Hi,
do you know a genric funtion (udf or xslt or javacode) to substitute german umlaute ?
We have a lot of fields in the interface and wan´t to avoid to adopt a single function to each single fields.
Furthermore we don´t know which field could be filled with a german umlaute (every char field)
I tried to change the encoding from UTF-8(i.e. "Lübeck") to ISO 8859-1(i.e. result = "Lübeck") but without success.
Is there a generic function or other way to get this solved ?
Thanks,
Gordon
You can do it similar to this:
http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
Instead of &, you check for the different umlauts.
Can you tell me, why you want to replace the characters?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
thanks for the information.
We are sending IDoc-xml files with the JMS (MQ) to an external partner.
Example: Lübeck
In case we are using encoding = UTF-8 the IDoc and mapped xml file is filled with "Lübeck" but the partner need the "L(utf-8 code for ü)beck" or converted like "Luebeck".
The external partner send the message to another partner and there is an error like "L?',.beck"
any ideas ?
Are you talking about websphere?
http://www-01.ibm.com/software/globalization/ccsid/ccsid_registered.jsp
The parameter is called CCSID
1209 stands for UTF-8
"A JMS error occurred while processing message: xxxxx. The JMS provider gave the error mesage as MQJMS1046: The character set Cp1209 is not supported Cp1209, and the error code as MQJMS1046."
Can I use 1208 ?
edit:
I checked the Websphere monitor and saw that we are allready using ccsid 1208 for the message.
The monitor shows the xml message with umlaute "Lübeck".
Is that correct ? Maybe the partner has to change something ?
Edited by: Gordon Breuer on Aug 5, 2010 2:28 PM
Edited by: Gordon Breuer on Aug 5, 2010 2:28 PM
Hi,
Even i faced a similar problem.
You have to create an XSLT mapping and import it in the imported archives:
XSLT mapping code will be :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="iso-8859-1" />
<xsl:template match="/">
<xsl:copy-of select="*" />
</xsl:template>
</xsl:stylesheet>
Now in the interface mapping you need to use this xslt mapping first followed by the original graphical mapping.
Hope this helps
Regards,
Sainath Chutke
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
When you change the encoding in the XML (you can use XMLAnonymizerBean for this also) then you have to apply a different CCSID related to the new encoding.
Before you start an integration scenario with a partner you have to negociate the encoding as part of the interface specification also. If you miss this part, you waste a lot of your time with try and error.
@Stefan:
I tried the java-mapping way(http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/9420 ) as a nice learning session but i found some strange issues.
int read_data;
if (read_data != '&')
...
this is not working because read_data has integer values instead of string values ?
I can´t check if there is an 'ü' (umlaut).
I checked the integervalue for "ü" = 195 but the value is used for other char´s, too (i.e for ä and é)
do you now a good way to check if there is a special char like "ä" or "ü" ?
Thanks,
Gordon
Another approach is using the method replaceAll of String
Like this:
byte[] bbuf = new byte[in.available()];
int bblen = in.read(bbuf);
String inputConverted = new String(bbuf,"UTF-8");
inputConverted = inputConverted.replaceAll("ü","ue");
inputConverted = inputConverted.replaceAll("ä","ae");
and so on.
I checked the integervalue for "ü" = 195 but the value is used for other char´s, too (i.e for ä and é)
Whenever you find 195 in your byte stream, you check the next character also, as 195 marks a two byte character.
So you replace the two bytes of the ü,ä,ö with the two single byte characters ue, ae,oe
if (read_data != 195)
out.write(read_data);
else {
read_data = in.read()
switch read_data ...
http://www.utf8-chartable.de/unicode-utf8-table.pl
Edited by: Stefan Grube on Aug 11, 2010 10:40 AM
@Stefan: Great Job .. the replaceAll method is working perfect!
Is it possible to get the length of each field (in the inputstream) ?
For example: Inputstream interface = IDoc (field MANDT = length 3)
Is it possible to get the lnterfacestructure of the fields used in the mapping or do i have to read the XSD in my java mapping ?
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.