Application Development 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: 

How can I create files in unicode format without "byte order mark"?

Former Member
0 Kudos

Hello together,

I have to export files in UTF-8 format and have to send them to another partner system which works with linux as operating system.

I have tried the different possibities to create files with ABAP. But nothing works 100% how I want.

Some examples:

1.)

OPEN DATASET [filename] FOR OUTPUT IN TEXT MODE ENCODING UTF-8.

If I create a file in this way and download it from application server to local system the result for file format in a unicode text edior like NotePad is "ANSI AS UTF-8". This means I have no BYTE ORDER MARK inside.

But it is also possible that the file format is only ANSI if the file contains no "special characters", isn't it?

In my test cases I create 3 files. 2 of them has format "ANSI AS UTF-8", and one only "ANSII".

After transfer to Linux I get as result 2 times UTF8 and one time ASCII as file format.

2.)

OPEN DATASET [filename] FOR OUTPUT IN TEXT MODE ENCODING UTF-8 WITH BYTE ORDER MARK.

With this syntax the result in local editor looks like ok. I get as format really "UTF-8".

But I get problems with the system which receives the files.

All files has the file format UTF-8 on Linux but the interface / script can not read the file with BYTE ORDER MARK.

This is a very big problem for me.

Do anybody of you know if it possible to force creation in UTF-8 without a BYTE ORDER MARK?

This means more or less the first example but all files should have UTF-8 format!

Thanks in advance

Christian

2 REPLIES 2

rainer_hbenthal
Active Contributor
0 Kudos

You cant take a shower without getting wet.

Or i misunderstood you completly. Either you need the byte order mark or not.

0 Kudos

This means it is not possible to create a pure unicode file without the byte order mark?

You wouldn't happen to know how a file with byte order mark should read on a Linux system?

Or if this possible or not?

Regards

Christian