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: 

Non-unicode system writing non-unicode files when specified UTF8 with BOM

968

Hi,

We are trying to write a UTF8 file (with a BOM) on Application Server using ABAP using the following statement:

OPEN DATASET <file> FOR OUTPUT IN TEXT MODE ENCODING UTF-8 WITH BYTE-ORDER MARK IGNORING CONVERSION ERRORS.

While on the unicode environments, this works perfect; however, on non-unicode environments ([a]Netweaver 7.3, app server code page 1100; and [b] Netweaver 7.31, app server code page 1160) the files are produced without BOMs and in the code page matching of the app server.

a) Is this the expected behaviour, that this specification is being ignored "ENCODING UTF-8 WITH BYTE-ORDER MARK"?

b) Is there a workaround for this? Note, the file is large and memory is limited, so using binary and character conversion in memory are not ideal options.

Thanks,
Jay 🙂

4 REPLIES 4

alichtenau
Product and Topic Expert
Product and Topic Expert
502

Hi Jay,

please check SAP Note 27 and 788449.

It explains how to use the BOM. So I would suggest trying to create the files with method CREATE_UTF8_FILE_WITH_BOM of class CL_ABAP_FILE_UTILITIES.


Best regards,
Andreas

0 Kudos
502

I don't see in the documentation that it wouldn't work on a non-Unicode system. Isn't there an issue either in OPEN DATASET or in the documentation?

alichtenau
Product and Topic Expert
Product and Topic Expert
0 Kudos
502

True Sandra. I do not think this is an OPEN DATASET issue, because it worked for years. Maybe support can bring some light.

Sandra_Rossi
Active Contributor
502

It looks like that either it's a bug of OPEN DATASET or the ABAP documentation is incomplete. I suggest that you open a ticket at SAP support.