Mail adapter module  UTF-8 to ISO-8859-1 conversion

Hi!
I've a problem with a mail attachment which is generated by an adapter module for the mail adapter. The content type is set to "Application/EDIFACT; charset=iso-8859-1" when I add the attachment, but the mail adapter ignores the charset-setting.
Therefore german "umlauts" like ü are displayed in a wrong way: ü
When I set the content, I transform it in ISO-8859-1 : attachment.setContent(edifactString.getBytes("ISO-8859-1"),"ISO-8859-1");
When I test the result of edifactString.getBytes("ISO-8859-1"), I get the String in the right character encoding, but the mail adapter seems to "fix" the encoding
I also tried to use the messageTransformBean, but it doesn't worked.
Anyone knows how to solve this issue?
Best regards,
Daniel

Hi all!
I found a solution for this problem: First I used the TextPayload-Object for the Attachment which should be added. It seems that the TextPayload-Object has some bugs handling different encodings (handels only Unicode and deletes the charset=... setting from the ContentType).
When using the Payload object for the attachment (which handles binary data), there is no conversion to Unicode, so I get my attachment as desired (but still without the charset-setting).
Best regards,
Daniel

Similar Messages

  • Mail Sender - Encoding (I need to change from UTF-8 to ISO-8859-1)

    Hi,
    I'm getting data from email (in ms exchange) using the Mail Sender Adapter.
    In the e-mails exists characters as ç (ccedil), ã (atilde), õ (otilde) and others. The XI cannot read this characters because the encode in XML is UTF-8.
    How I do to change the encode in XI from UTF-8 to ISO-8859-1 ?
    Thank you!

    Unfortunately most mail server do not apply the codepage to the content type of a mail.
    In this case you have to set the content type with help of the MessageTransformBean:
    Transform.ContentType      text/plain;charset="ISO-8859-1"
    Regards
    Stefan

  • Receiver Mail Adapter Module Parameters

    Hello PI Experts,
    Can anyone pls provide me Mail adapter module parameter details for xml to txt file conversion. I have found a few but none of them are working, can you pls provide me some active links.
    Thanks,
    Sri

    I need MAIL Adapter module transformation parameter for converting my attachment from xml to text file -
    I have gone thro few forums and modified my comm channel, but still getting xml file as an output attachment  instead of a text file.
    Can anyone please suggest me how to change the module parameters to covert from xml file to text.
    I have added these module processing - please help.
    Processing sequence
    localejbs/AF_Modules/MessageTransformBean - Local Enterprise Bean - XML2Plain
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean - Local Enterprise Bean - Mail
    Module configuration
    XML2Plain - xml.endSeparator - 'nl'
    XML2Plain - xml.fieldNames  - Field1,Field2,Field3
    XML2Plain - xml.fieldSeparator - |                     |
    XML2Plain - Transform.Class - com.sap.aii.messaging.adapter.Conversion
    XML2Plain - Transform.ContentDisposition - attachment;filename="extract_p.txt"
    XML2Plain - Transform.ContentType - xml/plain;charset='UTF-8";name="extract_p.txt"
    XML2Plain - xml.recordsetStructure - Details
    Thanks,
    Sri

  • XML Encoding Issue - Format UTF-16 to ISO-8859-1

    Dear Groupmates,
    I have data in my Internal table which i am converting to XML using custom Transformation.
    Data is going to third party.The third party system requires data in ISO-8859-1 Format but SAP is generating the same in UTF-16 Format.I have been able to change the format of file from
    utf-16 to ISO-8859-1 format but after conversion i am getting invalid tag information in form of characters
    like &lt , &gt etc..in my file.
    Here is the code i have used to set the encoding to ISO-8859-1 :-
    DATA: xmlout TYPE xstring.
    DATA: ixml TYPE REF TO if_ixml,
    streamfactory TYPE REF TO if_ixml_stream_factory,
    encoding TYPE REF TO if_ixml_encoding,
    ixml_ostream TYPE REF TO if_ixml_ostream.
    ixml = cl_ixml=>create( ).
    streamfactory = ixml->create_stream_factory( ).
    ixml_ostream = streamfactory->create_ostream_xstring( xmlout ).
    encoding = ixml->create_encoding(
    character_set = 'ISO-8859-1' byte_order = 0 ).
    ixml_ostream->set_encoding( encoding = encoding ).
    Sample Output :-
    <?xml version="1.0" encoding="iso-8859-1"?>
    <AMS_DOC_XML_EXPORT_FILE><AMS_DOCUMENT AUTO_DOC_NUM="FALSE" DOC_CAT="CA" DOC_CD="CA" DOC_DEPT_CD="045" DOC_ID="XR10281060830400001" DOC_IMPORT_MODE="OE" DOC_TYP="CH" DOC_UNIT_CD ="NULL" DOC_VERS_NO="01">
    <CH_DOC_HDR AMSDataObject="Y">
    <DOC_CAT Attribute="Y">&lt;![CDATA[CA]]&gt;</DOC_CAT>
    <DOC_TYP Attribute="Y">&lt;![CDATA[CH]]&gt;</DOC_TYP>
    Please let me know if anyone has idea how i can get rid of the invalid tag information.
    Thanks !
    With Regards,
    Darshan Mulmule

    Darshan,
    Did you get an answer for this question? We have same requirement to create XML file in ISO-8859-1 format with Attributes is set to "Y" and CDATA is being used for data.
    Can you please let me know if you still remember how did you achieve it?
    Satyen...

  • Mail Adapter Module Problem!

    Hi All
    I m facing a problem in implementing a custom mail adapter module.
    The scenario is to set the content type based on the file type. eg: if the file being sent is a pdf then content type should be "application/pdf".
    I hope the scenario is clear, please feel free to ask for clarifications.
    awaiting your replies.
    Regards
    Kapil

    Hi All
    I am able to fetch the file name now and set the content type based on the file name. But I m not able to change the name of attachment of mail. For reference, I m pasting the code here, please suggest how to do the latter part
    try {
                         // CS_GETCHADAT START
                         cid  = moduleContext.getChannelID();
                         Channel channel = new Channel(cid);
                         // Example to access a channel configuration parameter in a module: String someParameter = channel.getValueAsString("YourAttributeName");
                         // CS_GETCHADAT END
                        fileName = msgg.getMessageProperty("http://sap.com/xi/XI/System/File","FileName");
                        Payload attachment = msgg.getAttachment("MainDocument");
                             StringTokenizer st = new StringTokenizer(fileName, ".");
                             while(st.hasMoreTokens()){
                                  extension = st.nextToken();     
                        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: filename " + fileName);
                        Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: extension " + extension);
                             // create new payload
                             Audit.addAuditLogEntry(amk, AuditLogStatus.SUCCESS, "RenameFile: attchmntName " + attachment.getName().toString());
                             //provide attributes and content for the new payload
                             attachment.setName("Attachment :" + fileName);
    //                         msgg.setMessageProperty("http://sap.com/xi/XI/System/File","content-description",fileName);
                             attachment.setContentType("application/" + extension );
                             inputModuleData.setPrincipalData(msgg);

  • Decode UTF-8 to ISO-8859-1

    I am using the Google Maps API, it return in utf-8,
    so for some countries, caracters are wrong,
    My server is ISO-8859-1
    So, how to convert the result from utf-8 to iso-8859-1 ?
    I tried :
    <cfprocessingdirective pageEncoding="UTF-8">
    <cfcontent type="text/html; charset=UTF-8">
    <cfset setEncoding("URL", "UTF-8")>
    <cfset setEncoding("FORM", "UTF-8")>
    and
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    No change. always the wrong caracters,
    Thanks for any help with this mess.
    Pierre.

    I am using CF v7.
    My server and CF are ISO-8859-1.
    But I am using Google Maps API , which returns country names in UTF-8.
    I tried the Google Maps directives, with adding parameter eo=ISO-8859-1 in the Google Key <script>,
    same result.
    Then  I have to convert to ISO-8859-1 , at least in that page for country names.
    (I have a specific problem with Thailande, Google Maps returns :  Tha๏lande
    and in the data base it writes : tha&#3663 ;lande   (an Access database)
    I answer to injun [576871]  ,
    Diificult to insert that code, because I am in a JavaScript code already.
    So it will not accept <cfscript> again inside ? I will try.
    Thanks for any help.
    Pierre.

  • HTTP-Receiver: Code page conversion error from UTF-8 to ISO-8859-1

    Hello experts,
    In one of our interfaces we are using the payload manipulation of the HTTP receiver channel to change the payload code page from UTF-8 to ISO-8859-1. And from time to time we are facing the following error:
    u201CCode page conversion error UTF-8 from system code page to code page ISO-8859-1u201D
    Iu2019m quite sure that this error occurs because of non-ISO-8859-1 characters in the processed message. And here comes my question:
    Is it possible to change the error behaviour of the code page converter, so that the error will be ignored?
    Perhaps the converter could replace the disruptive character with e.g. u201C#u201D?
    Thank you in advance.
    Best regards,
    Thomas

    Hello.
    I'm not 100% sure if this will help, but it's a good Reading material on the subject (:
    [How to Work with Character Encodings in Process Integration (NW7.0)|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42]
    The part of the XSLT / Java mapping might come in handy in your situation.
    you can check for problematic chars in the code.
    Good luck,
    Imanuel Rahamim.

  • Abap Proxy Convert UTF-8 to ISO-8859-1

    Dear,
    I have the following scenario:
    Abap Proxy-> PI -> WebService.
    I need to change the encondig UTF-8 to ISO-8859-1 when the SAP ECC sends data to the PI.
    How do I do this?
    I have a XSLT program that performs the this conversion, UTF-8 to ISO-8859-1, between PI and WebService.
    Regards,
    Sérgio Salomã

    To understand more about Character Encoding in SAP Process Integration. You can refer the following link:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/502991a2-45d9-2910-d99f-8aba5d79fb42?quicklink=index&overridelayout=true

  • HTTP adapter - change encoding from UTF-8 to ISO-8859-1

    Hi,
    I am trying to change the encoding used by the HTTP sender adapter in a scenario.
    However, when I enter ISO-8859-1 in the XML Code under XI Payload Manipulation on the comms channel it has no effect - the paylad still shows as UTF-8 in SXI_MONITOR.
    Am I missing a step or entering the field incorrectly ??
    Thanks
    Colin.

    Hi,
    From help
    Enhancing the Payload
    Some external systems, for example, Web servers in marketplaces, can only process data if it is sent as an HTML form using HTTP.
    A typical HTML form comprises named fields. When transferring a completed form to the server or a CGI program, the data must be transferred in such a way that the CGI script can recognize the fields that make up the form, and which data was entered in which field.
    The plain HTTP adapter constructs this format using a prolog and an epilog. Therefore, there is a particular code method that separates form fields and their data from each other. This code method uses the following rules:
         Individual form elements, including their data, are separated from each other by the character &.
         The name and data of a form element are separated from each other by an equals sign (=).
         Blanks in the entered data (for example, in multiple words) are replaced by a plus sign (+).
        All characters with the (enhanced) ASCII values 128 to 255 (hexadecimal 80 to FF) are transcribed using a hexadecimal sequence, beginning with a percentage sign (%) followed by the hexadecimal value of the character (for example, the German umlaut ö in the character set ISO-8859-1 is transcribed as %F6).
       All characters that occur in these rules as control characters (&, +, =, and %) are also transcribed hexadecimally in the same way as high value ASCII characters
    http://help.sap.com/saphelp_nw2004s/helpdata/en/44/79973cc73af456e10000000a114084/content.htm
    Regards
    Chilla

  • Change encoding from utf-8 to iso-8859-1 in JMS receiver!

    Hi.
    I have some problems regarding encoding.
    The simple setup: dummy datatype as input, XSLT mapping and standard XI output(to JMS).
    Are there any way to tell the JMS adapter to deliver the message in iso-8859-1 and not utf-8?
    Regards Peter

    > Hi Henrique.
    >
    > This sounds like an idea. Can you guide me to some
    > documentation, that describes adding mapping in the
    > jms adapter module?
    >
    > Regards Peter
    To use modules in JMS adapter: http://help.sap.com/saphelp_nw2004s/helpdata/en/0f/80243b4a66ae0ce10000000a11402f/frameset.htm
    Now, you add the MessageTransforBean module, to use the XSLT mapping. Check the end of this blog to learn how to use XSLT mapping on MessageTransformBean: /people/michal.krawczyk2/blog/2005/11/01/xi-xml-node-into-a-string-with-graphical-mapping
    Regards,
    Henrique.

  • Nerving Problem with UTF-8 and ISO-8859-1

    Hi,
    I´m looking for a solution to serve this problem for many hours now, maybe someone can help me:
    1.) We need to send our Mails with the ISO-8859-1-Charset because otherwise Windows-Users get the text in the message twice: once as plain, and after a question mark formated. So I changed the NSPreferredMailCharset in the com.apple.mail.plist to ISO-8859-1:
    defaults write com.apple.mail NSPreferredMailCharset "ISO-8859-1"
    2.) So far so good. It works until I add an attachment to a message. Adding an attachment forces the sending of the mail again as Unicode (UTF-8). I could change the encoding manual, but thats not the way we can work in our company.
    My question is: is there any way to force mail to encode as ISO-8859-1? It can´t be that we have to change the encoding for every message.
    Thanks a lot
    florian
    PS: I´m not sure if this is important: we use the osx in German.

    I was thinking that since he is from Austria & references a company, there is a very strong possibility that the character "€" (the Euro currency symbol, Unicode 20AC, UTF-8 E2 82 AC) would frequently appear in messages.
    Even if he sets a preference for ISO-8859-1 as the default with Terminal, or manually changes messages to ISO-8859-1, it would not be possible to include this symbol in such messages, since there is no "€" in ISO-8859-1.
    Similar problems would occur with other symbols sometimes used in business (for example "™"), in engineering ("Ω"), in mathematics ("∑"), or even with some general punctuation marks such as the dagger ("†").
    Other possible problems are the use of other currency symbols the Euro replaced (the franc's "₣" or the lira's "₤") or others still in use (the Israeli new sheqel's "₪ or rupee's "₨"). Ligatures in an international environment would really complicate things as well, as this Wikipedia article about the Œthel illustrates.
    Note that in none of these cases would the presence or absence of an attachment matter -- ISO-8859-1 simply isn't up to the task.
    I suspect that in some cases, if it is possible, setting the default to Windows-1252 (Windows Latin 1 in Mail's list?) would help, since it does include at least the Euro & dagger. I haven't played around with this much, but I do note that in a new message window containing "€" in the body, if I set the text encoding to Windows Latin 1, Automatic, or UTF-8, Mail doesn't complain, but if I set it to ISO Latin 1, I get an error saying the message can't be saved & an "Invalid Text Encoding" alert if I try to send it.
    As for how messages are received at the other end, Windows apps (not just Outlook) are notorious for continuing to use non-Unicode API's even after the OS itself has long since moved to Unicode as its internal standard. Some of them employ bass-ackwards fixes like deciding ISO-8859-1 declarations are supposed to be Windows-1252 ones. Worse, Windows itself sometimes seems to interpret a few Windows-1252 code positions as their ISO-8859-1 control equivalents!
    All this makes life that much more complicated for people trying to avoid problems like the above.

  • Change "subject" in Receiver Mail Adapter Module

    Hi all,
    following the "How To Guide" I developed a Module for my receiver mail adapter. Everything works fine.
    Now my question: is it possible to change the content of the mail-"subject" in the module?
    Your help is appreciated.
    Carmen

    Hi Stefan,
    maybe I should describe my problem more detailed:
    My scenario is RFC-XI-Mail. I use the mail package to determine the receiver of the mail dynamically. Another thing I want to do, is to attach a file to this mail which is located on the server. So far so good.
    My problem is, that the name of the file (which I need in my adapter module) changes for every mail. So what I need is the possibility to deliver it to the adapter module.
    I found out that it is possible to read the payload. So my idea was to hand it over in one of the fields like "subject". But now I want to change the subject afterwards...(delete the filename).
    Maybe you have another idea?
    Regards
    Carmen

  • Problem with mail adapter module in PI 7.11

    Hi,
    I modified our adapter module from PI 7.0 to be compatible with PI 7.11 SPS3. I followed the instruction in http://www.sdn.sap.com/irj/scn/index;jsessionid=(J2EE3417300)ID1491632150DB11633962752589437606End?rid=/library/uuid/c0b39e65-981e-2b10-1c9c-fc3f8e6747fa&overridelayout=true and successfully deployed the adapter module using NWDS for PI 7.1. However, I am encountering this error in the communication channel monitoring:
    Exception caught during processing mail message com.sap.aii.af.lib.mp.module.ModuleException.
    I don't see any other details in the communication channel monitoring to help me determine the cause of the problem after this error message line. In NWDS, there was no error when I excute build the project. During deployment in NWDS, it says deployment was successful. When I check in NWA, I can find that the adapter module has been deployed successfully. I even tried to re-create the whole adapter module from scrach following the documentation for the 2nd time and still I got the same error message.
    I am using java SDK 6.
    Any help or suggestion would be greatly appreciated.
    Regards,
    Elbert

    Hi,
    This problem is now solved. I am using the correct version of NWDS for PI7.1 and using java 1.6 will not cause any problem.
    The problem was caused by the source data being zipped instead of the unzipped version that my module is expecting. Furthermore, since my module comes before the mail bean, there is no details in the communication channel monitoring that the data sent was a wrong format.
    Regards,
    Elbert

  • Remove Attachment in Mail Adapter Module

    Hi!
    My problem: I get an email with an attachment which I process in an adapter module for the mail adapter. With the resulting XML I set a new payload, but the old attachment still exists.
    This gets to a problem when I route the message back to the mail adapter, he adds the old attachment to the generated email. Therefore the new email has two attachments: the old one and the new one, which should only be one attachment: only the new one.
    How can I remove the old attachment? I found no function which solves this problem.
    Best regards,
    Daniel

    Hi Michal,
    thanks for the link.
    When I import aii_proxy_xirt.jar in my NWDS, I can import the MessageSpecifier class. But I can't get an instance of it from the classes which I can access.
    The only 'documented' usages of this class I found were codings for java proxies, so I'm not sure we can use this class in an adapter module.
    In this cases they get the MessageSpecifier instance from the proxy bean, so maybe we can get it from the EJB, but this doesn't work with an adapter module (or I haven't found out how )
    Hmm. It is a simple problem, but it seems difficult to solve
    Best regards,
    Daniel
    Message was edited by: Daniel Himmel

  • Convert utf-8 to iso-8859-1

    Hello,
    sorry for my very bad english
    i use httpxmlrequest to answer a database and show resultin a
    div
    the string means utf-8 encoded by my javascript fonction and,
    of course,
    no result are found in the database.
    How can i convert the string to iso-8859-1 before request the
    database ?
    Thank if you have an idea
    JiBé (France)

    PaulH **AdobeCommunityExpert** a écrit :
    > Jibé wrote:
    >> PaulH **AdobeCommunityExpert** a écrit :
    >> I work with a MS SQL server database encoding in
    iso-8859-1
    >
    > data stored in plain text,char,varchar datatypes (ie not
    "N")?
    datatype of "titre" is varchar(250) and "contenu" is text
    using the
    > ODBC or JDBC (it would be listed as ms sql server in the
    db drivers
    > list) driver?
    I think it's jdbc driver (case of my test computer)
    >
    >> The code :
    >
    > you're not following good i18n practices. while my
    preference is for
    > unicode ("just use unicode" has been my motto for
    years), if you're
    > really only ever going to use french & never need
    the euro symbol then i
    > guess iso-8859-1 (latin-1) is fine.
    Here is a part of the content of my application.cfm
    <cfprocessingdirective pageencoding="iso-8859-1">
    <cfcontent type="text/html; charset=iso-8859-1">
    <cfset setEncoding("URL", "iso-8859-1")>
    <cfset setEncoding("Form", "iso-8859-1")>
    >
    > if you think you might need other languages, including
    the euro symbol,
    > then you should consider unicode. change your text
    columsn to "N" type
    > (nText, nChar, nVarChar) & swap the latin-1
    encodings in the tags above
    > to utf-8.
    I'm going to test that....
    JiBé

Maybe you are looking for

  • Maverick 9.5.2 update has broken Mail, Safari & AppStore

    Hi I have mid 2010 MacBook Pro and last night installed update of Mavericks. On restart, Mail was not not showing the message in the preview pane (or when double clicking the message open). Then when I opened Safari, I wasn't able to see anything in

  • My website browser bar is missing. There's nowhere for me to enter a URL, how do I get it back?

    About a week ago, Firefox stopped connecting to the server. Today, I completely uninstalled Firefox and then reinstalled the latest version (not Beta 4!) I opened it up and the connection seems to be working fine but there's no bar for entering in we

  • SQL Developer 1.5.4 MySQL migration bug

    Trying to use SQL Developer 1.5.4 to "Capture" MySQL schema. Getting this Java exception: java.lang.Exception: java.lang.NullPointerException      at oracle.dbtools.migration.workbench.core.ui.AbstractMigrationProgressRunnable.start(AbstractMigration

  • Creative Wireless Music Prob

    Hello, I am ready to return this product for service. It worked somewhat after my initial setup. I updated the software and firmware to improve performance, and now the remote does not communicate with the base station. I can play music through the s

  • Iphoto crashing all the time

    Hi guys, my dad has got a problem with his new Imac, he's had it about a month or so now and since upgrading some of the software the other day it has been playing silly buggers!! Firstly after the upgrades Safari, itunes and Iphoto stopped working.