<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: text file attachment in UTF-8 encoding in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991283#M706501</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;before sending the mail you have to encode your textfile into utf-8 . here is the code sample for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: binary_content type solix_tab ,
      text_string type string .
data: xs_content type xstring ,
       app_type(50) .

app_type = 'text/plain; charset=utf-8'.

call function 'SCMS_STRING_TO_XSTRING'
  exporting
    text     = text_string
    mimetype = app_type
  importing
    buffer   = xs_content.


concatenate  cl_abap_char_utilities=&amp;gt;byte_order_mark_utf8
             xs_content
             into xs_content in byte mode.
refresh binary_content .
clear:len, length .
call function 'SCMS_XSTRING_TO_BINARY'
  exporting
    buffer     = xs_content
  importing
  output_length = length
  tables
    binary_tab = binary_content.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now you can use binary_content table for emailing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 13 Nov 2007 08:03:14 GMT</pubDate>
    <dc:creator>athavanraja</dc:creator>
    <dc:date>2007-11-13T08:03:14Z</dc:date>
    <item>
      <title>text file attachment in UTF-8 encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991282#M706500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a program which sends  mails to the users with text file attached. the problem is the text file when you save it to the local desktop ( by clicking on save as ) the encoding is by default ANSI. I want to make the encoding as UTF-8. Is it possible to change this in program?.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 06:16:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991282#M706500</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T06:16:58Z</dc:date>
    </item>
    <item>
      <title>Re: text file attachment in UTF-8 encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991283#M706501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;before sending the mail you have to encode your textfile into utf-8 . here is the code sample for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: binary_content type solix_tab ,
      text_string type string .
data: xs_content type xstring ,
       app_type(50) .

app_type = 'text/plain; charset=utf-8'.

call function 'SCMS_STRING_TO_XSTRING'
  exporting
    text     = text_string
    mimetype = app_type
  importing
    buffer   = xs_content.


concatenate  cl_abap_char_utilities=&amp;gt;byte_order_mark_utf8
             xs_content
             into xs_content in byte mode.
refresh binary_content .
clear:len, length .
call function 'SCMS_XSTRING_TO_BINARY'
  exporting
    buffer     = xs_content
  importing
  output_length = length
  tables
    binary_tab = binary_content.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now you can use binary_content table for emailing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 08:03:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991283#M706501</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2007-11-13T08:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: text file attachment in UTF-8 encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991284#M706502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OPEN DATASET - encoding &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Syntax &lt;/P&gt;&lt;P&gt;... ENCODING { DEFAULT &lt;/P&gt;&lt;P&gt;             | {UTF-8 [SKIPPING|WITH BYTE-ORDER MARK]} &lt;/P&gt;&lt;P&gt;             | NON-UNICODE } ... . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternatives: &lt;/P&gt;&lt;P&gt;1. ... DEFAULT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. ... UTF-8 [SKIPPING|WITH BYTE-ORDER MARK] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. ... NON-UNICODE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;: The additions after ENCODING determine the character representation in which the content of the file is handled. The addition ENCODING must be specified in Unicode programs and may only be omitted in non-Unicode programs. If the addition ENCODING is not specified in non-Unicode programs, the addition NON-UNICODE is used implicitly. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note &lt;/P&gt;&lt;P&gt;: It is recommended that files are always written in UTF-8, if all readers can process this format. Otherwise, the code page can depend on the text environment and it is difficult to identify the code page from the file content. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 1 &lt;/P&gt;&lt;P&gt;... DEFAULT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;: In a Unicode system, the specification DEFAULT corresponds to UTF-8, and in a non-Unicode system, it corresponds to NON-UNICODE. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 2 &lt;/P&gt;&lt;P&gt;... UTF-8 [SKIPPING|WITH BYTE-ORDER MARK] &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition: &lt;/P&gt;&lt;P&gt;... SKIPPING|WITH BYTE-ORDER MARK &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;: The characters in the file are handled according to the Unicode character representation UTF-8. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;: The class CL_ABAP_FILE_UTILITIES contains the method CHECK_UTF8 for determining whether a file is a UTF-8 file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A UTF-16 file can only be opened as a binary file. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Addition &lt;/P&gt;&lt;P&gt;... SKIPPING|WITH BYTE-ORDER MARK &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;: This addition defines how the byte order mark (BOM), with which a file encoded in the UTF-8 format can begin, is handled. The BOM is a sequence of 3 bytes that indicates that a file is encoded in UTF-8. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SKIPPING BYTE-ORDER MARK &lt;/P&gt;&lt;P&gt;is only permitted if the file is opened for reading or changing using FOR INPUT or FOR UPDATE. If there is a BOM at the start of the file, this is ignored and the file pointer is set after it. Without the addition, the BOM is handled as normal file content. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WITH BYTE-ORDER MARK &lt;/P&gt;&lt;P&gt;is only permitted if the file is opened for writing using FOR OUTPUT. When the file is opened, a BOM is inserted at the start of the file. Without the addition, no BOM is inserted. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The addition BYTE-ORDER MARK cannot be used together with the AT POSITION. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notes &lt;/P&gt;&lt;P&gt;: When opening UTF-8 files for reading, it is recommended to always enter the addition SKIPPING BYTE-ORDER MARK so that a BOM is not handled as file content. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is recommended to always open a file for reading as a UTF-8 with the addition WITH BYTE-ORDER MARK, if all readers can process this format. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternative 3 &lt;/P&gt;&lt;P&gt;... NON-UNICODE &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Effect &lt;/P&gt;&lt;P&gt;: In a non-Unicode system, the data is read or written without conversion. In a Unicode system, the characters of the file are handled according to the non-Unicode codepage that would be assigned at the time of reading or writing in a non-Unicode system according to the entry in the database table TCP0C of the current text environment.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 08:04:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991284#M706502</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T08:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: text file attachment in UTF-8 encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991285#M706503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the binary_content table the data is  coming something like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FBBBF0A534F554D54534F5645524C4159303109544D6F6220554D5453204F7665726C6179&amp;lt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which seems to in binary form.  I am using SO_DOCUMENT_SEND_API1'&lt;/P&gt;&lt;P&gt;to send the mail with attachment. I am passing the text file content to the table parameter contents_bin . Now in this case how do I  use this binary_content in this FM?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 08:55:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991285#M706503</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-11-13T08:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: text file attachment in UTF-8 encoding</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991286#M706504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;pass the binary_content itab to CONTENTS_HEX tables parameter instead of contents_bin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Nov 2007 09:03:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/text-file-attachment-in-utf-8-encoding/m-p/2991286#M706504</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2007-11-13T09:03:11Z</dc:date>
    </item>
  </channel>
</rss>

