<?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 Conversion utf-16 unicode -&amp;gt; ASCII in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454530#M214910</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i read a utf-16 file. The read text is diplayed like this string:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yp&amp;lt;#?#x#m#l# #v#e#r#s#i#o#n#=#"#1#.#0#"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I convert the text? I haven't found functions to do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jul 2006 10:34:50 GMT</pubDate>
    <dc:creator>alexander_kutz</dc:creator>
    <dc:date>2006-07-12T10:34:50Z</dc:date>
    <item>
      <title>Conversion utf-16 unicode -&gt; ASCII</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454530#M214910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i read a utf-16 file. The read text is diplayed like this string:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yp&amp;lt;#?#x#m#l# #v#e#r#s#i#o#n#=#"#1#.#0#"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can I convert the text? I haven't found functions to do that.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2006 10:34:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454530#M214910</guid>
      <dc:creator>alexander_kutz</dc:creator>
      <dc:date>2006-07-12T10:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion utf-16 unicode -&gt; ASCII</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454531#M214911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you open the dataset, use the encoding option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open dataset dsn in input mode encoding 'utf-16'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2006 10:41:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454531#M214911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-12T10:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion utf-16 unicode -&gt; ASCII</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454532#M214912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is that supported?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I got an error if i tried to use UTF-16.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2006 10:50:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454532#M214912</guid>
      <dc:creator>alexander_kutz</dc:creator>
      <dc:date>2006-07-12T10:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion utf-16 unicode -&gt; ASCII</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454533#M214913</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;Check this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/ulrich.brink/blog/2005/08/18/unicode-file-handling-in-abap&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It may help.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Appana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2006 10:54:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454533#M214913</guid>
      <dc:creator>Laxmana_Appana_</dc:creator>
      <dc:date>2006-07-12T10:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion utf-16 unicode -&gt; ASCII</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454534#M214914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Appana, cl_abap_conv_in_ce seems to be the right class - but i can't get it to work. - To use it in combination with OPEN DATASET.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, the OPEN DATASET statement does not support UTF-16.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2006 13:11:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454534#M214914</guid>
      <dc:creator>alexander_kutz</dc:creator>
      <dc:date>2006-07-12T13:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion utf-16 unicode -&gt; ASCII</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454535#M214915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a QDAC (Quick &amp;amp; Dirty ABAP code) to convert UTF-16 file on app server to sap default codepage file.&lt;/P&gt;&lt;P&gt;Tested on a non-unicode 640 system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: gt_line type string occurs 0 with header line,
      gv_bin type xstring,
      conv_obj type ref to cl_abap_conv_in_ce.

parameters: in_file type rlgrap-filename,
            out_file type rlgrap-filename.

start-of-selection.
  check not in_file is initial.
  open dataset in_file for input in binary mode.
  do.
    read dataset in_file into gv_bin.
    if sy-subrc ne 0.
      close dataset in_file.
      exit.
    endif.

    if sy-index eq 1.
      perform create_conv_obj.
    endif.

    try.
        call method conv_obj-&amp;gt;convert
          exporting
            input = gv_bin
            n     = -1
          importing
            data  = gt_line.
      catch cx_sy_conversion_codepage .
      catch cx_sy_codepage_converter_init .
      catch cx_parameter_invalid_type .
    endtry.
    append gt_line.
  enddo.

  check not out_file is initial.
  open dataset out_file for output in binary mode.
  loop at gt_line.
    transfer gt_line to out_file.
  endloop.
  close dataset out_file.

*&amp;amp;--------------------------------------------------------------------*
*&amp;amp;      Form  create_conv_obj
*&amp;amp;--------------------------------------------------------------------*
form create_conv_obj.
  data: lv_bom(2) type x,
        lv_encoding type abap_encod,
        lv_endian type abap_endia.

  lv_bom = gv_bin.

  if lv_bom eq 'FFFE'.
    lv_encoding = '4103'.          "code page for UTF-16LE
    lv_endian = 'L'.
    shift gv_bin left by 2 places in byte mode.
  elseif lv_bom eq 'FEFF'.
    lv_encoding = '4102'.          "code page for UTF-16BE
    lv_endian = 'B'.
    shift gv_bin left by 2 places in byte mode.
  else.
    message 'Byte order mark not found at the begining of the file'
             type 'E'.
  endif.

  try.
      call method cl_abap_conv_in_ce=&amp;gt;create
        exporting
          encoding    = lv_encoding
          endian      = lv_endian
          replacement = '#'
        receiving
          conv        = conv_obj.
    catch cx_parameter_invalid_range .
    catch cx_sy_codepage_converter_init .
  endtry.

endform.                    "create_conv_obj&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sridhar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2006 21:33:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454535#M214915</guid>
      <dc:creator>sridhar_k1</dc:creator>
      <dc:date>2006-07-12T21:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Conversion utf-16 unicode -&gt; ASCII</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454536#M214916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I got it. There is a bug in the sap method to create a table of an xml object. The function makes intern a wrong unicode conversion. You have to use the function SO_SOLIXTAB_TO_SOLITAB after using cl_xml_document-&amp;gt;get_as_table to get a right conversion on a unicode system.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Jul 2006 07:04:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/conversion-utf-16-unicode-gt-ascii/m-p/1454536#M214916</guid>
      <dc:creator>alexander_kutz</dc:creator>
      <dc:date>2006-07-18T07:04:25Z</dc:date>
    </item>
  </channel>
</rss>

