this is my code, generated xml file header like this " <?xml version="1.0" encoding="utf-8"?> "
and the Actual Encoding is 'ANSI as UTF-8' too, but at the end of the file, there are many 'nul', more detail in the attachment
the file cannot recognized by ie or chrome and some xml editor
if i delete the 'nul', it is exactly correct
DATA: x_xml TYPE xstring,
lt_xml TYPE solix_tab .
CALL TRANSFORMATION zst02
SOURCE root = gt_mara
RESULT XML x_xml.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
buffer = x_xml
binary_tab = lt_xml.
CALL FUNCTION 'GUI_DOWNLOAD'
filename = 'c:\xmlcal-3.xml'
filelength = w_len
data_tab = lt_xml.
if call method l_con->xstring_to_string translate xstring to string
then, call func 'SCMS_STRING_TO_FTEXT'
then, download the file using 'gui_download'
the xml file header like this " <?xml version="1.0" encoding="utf-8"?> "
but the actual encoding is UCS-2