cancel
Showing results for 
Search instead for 
Did you mean: 

Convert German characters to UTF-8.

0 Kudos

Hello Experts,

We have a scenario in which one of the field receives a url which contains German characters, here we have to encode only German characters along with underscore(_) to UTF-8 but not the complete url.

URL example:

https://scn.sap.com/abc-/germancharacters/%d&&devsystem/_p_&&client-123?

from the above url we have to encode only germancharacters and (_) but not the complete url, also will it work if we encode complete url?

Please suggest any UDF to encode the url.

thanks in advance

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi All,

Thanks your suggestions.

the below UDF helped me in sloving the issue.

Answers (1)

Answers (1)

RaghuVamseedhar
Active Contributor
0 Kudos

Madhukar,

Please write a UDF. Input is URL string. Output is encoded URL string.


try {

            return java.net.URLEncoder.encode(inputURLString, "UTF-8");

        } catch (UnsupportedEncodingException ex) {

            throw new StreamTransformationException(ex.toString());

        }

FYI.

HTML URL Encoding Reference

0 Kudos

Thanks raghu,

I have used the UDF and it is converting the URL in to the required format, but facing with the below error.

An error occurred when sending the document to Ariba Network Error: [[Code]: ERR303 [Description]: Outbound Transaction Failed [Message]: Creation of MIME message for the Outbound Request failed] causes a XIAdapterException and can be retried

should we have to use any module in channel or in UDF?

please suggest...

RaghuVamseedhar
Active Contributor
0 Kudos

Madhukar,

To check, if the encoding of URL is causing the issue (UDF is causing the issue).

1. Remove the UDF. Map that target field with a constant "https://www.google.com"

2. If error persist, then it is not issue with UDF. If there is no error, then we have to recheck UDF.

0 Kudos

Hi Raghu,

I have tried with constant valu with out any UDF its working fine.

Can you please help me wheather any changes to be made to UDF,.