Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

UTF-8 file creation using ABAP

Former Member
0 Likes
2,063

I want to create a UTF-8 file on Application Server.

Question 1:

I tried using statement 'Open dataset for output in text mode encoding utf-8'. The file was created. Then I used CL_ABAP_FILE_UTILITIES=>CHECK_UTF8 to check the encoding. 'A' was returned respresenting ASC.

Any suggestion on this?

Or is there any option to convert a ASC file to UTF-8?

Question 2:

After creating the file on Application Server, I used code below to check the encoding.

call method CL_ABAP_FILE_UTILITIES=>CHECK_UTF8

EXPORTING

file_name = fname

IMPORTING

encoding = encoding.

if encoding = CL_ABAP_FILE_UTILITIES=>ENCODING_UTF8.

write: / fname, 'File format is UTF-8.'.

else.

write: / fname, 'File format is not UTF-8.'.

endif.

When I was using this method to check a local file, i got error. can't this method do that?

Thanks.

Legend.

1 REPLY 1
Read only

Former Member
0 Likes
1,010

Our SAP server is Windows, is it possible to create a UFF-8 file?

I used parameter 'encoding UTF-8' while creating the file on App Server as above.

then I downloaded the file using 'Gui_download' with parameter codepage = 4110, then i got a UTF-8 file on local machine.

why utf-8 file wasn't created on App server?

too many questions here.

Thanks All.

Legend.