cancel
Showing results for 
Search instead for 
Did you mean: 

Handling special characters in XI

former_member210677
Participant
0 Kudos

Hi Experts,

Need your suggestions on how to handle the special character Ø in the payload coming from ecc. which means i need to know how to handle the character Ø coming from idoc.

Appreciate your quick response on this.

Thanks & Regards,

Ranganath.

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

Need your suggestions on how to handle the special character Ø in the payload coming from ecc. which means i need to know how to handle the character Ø coming from idoc.

What do you want to do and why?

This is a valid character and there is in principe no need to do anything.

Former Member
0 Kudos

Its a valid european language character.

what you want to do with it?

-santosh.

former_member210677
Participant
0 Kudos

HI Anupam/Stefan/santhosh,

Thanks a lot for your prompt replies.

We are facing issue while sending the char "Ø" to the target end. It is geting converted to Ãu02DC . So kindly can u seggest me how to pass on the same char "Ø" without getting interpreted to any char to the target end.

Awaiting your reply

Thanks & Regards,

Ranganath

stefan_grube
Active Contributor
0 Kudos

We are facing issue while sending the char "Ø" to the target end. It is geting converted to Ãu02DC . So kindly can u seggest me how to pass on the same char "Ø" without getting interpreted to any char to the target end.

Read this:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79f...

Former Member
0 Kudos

hi Ranganath,

I am not sure if this helps, but can you please try using an encoding in the receiver channel like :-

MessageTransformationBean module key -- > Transform.ContentType -- > text/xml;charset = iso-8859-1

Regards,

Ninu

anupam_ghosh2
Active Contributor
0 Kudos

Hi Ranganath,

Are you receiving any errors in PI message mapping due to presence of this symbol? Then you need to ask the sender to stop sending this symbol.

If you are not receiving any errors (most probably you should not receive any errors) and you only want to remove the character to flow from source to target then use the following UDF in your message mapping


String removeChars(String s, Container container)
{
		try
		{
			int i,l;
			l=s.length();
			String a="";
			for(i=0;i<l;++i)
			{
				if(s.charAt(i)==216 || s.charAt(i)==248)
				{
					continue;
				}
				a=a+s.charAt(i);
			}
			s=a;
		}
		catch(Exception e)
		{
			return s;
		}
		return s;
}
	

If you want to replace this character by another String (say "B")

please use the UDF below


public static String replaceChars(String s,Container container)
	{
		try
		{
			int i,l;
			String replacement_string="B";
			l=s.length();
			String a="";
			for(i=0;i<l;++i)
			{
				if(s.charAt(i)==216 || s.charAt(i)==248)
				{
					a=a+replacement_string;
					continue;
				}
				
				a=a+s.charAt(i);
			}
			s=a;
		}
		catch(Exception e)
		{
			return s;
		}
		return s;
	}

regards

Anupam

Edited by: anupamsap on Oct 5, 2011 8:37 PM

Edited by: anupamsap on Oct 6, 2011 8:33 PM