2009 May 11 1:40 PM
Dear Experts,
for an interface we are uploading text files (format UTF-8) from application server (AIX system) using "OPEN DATASET file IN TEXT MODE ENCODING DEFAULT FOR INPUT." Some of the source systems are sending these files with BoM (Byte order marker) other systems without.
For correct data transfer and processing I have to ignore the BoM.
Is there any possibility to ignore the BoM during reading of the file?
Thank you in advance for your help.
Thomas
Dear Experts,
for an interface we are uploading text files (format UTF-8) from application server (AIX system) using "OPEN DATASET file IN TEXT MODE ENCODING DEFAULT FOR INPUT." Some of the source systems are sending these files with BoM (Byte order marker) other systems without.
For correct data transfer and processing I have to ignore the BoM.
Is there any possibility to ignore the BoM during reading of the file?
Thank you in advance for your help.
Thomas
2009 May 11 1:53 PM
I just found the solution - I've to use addition "SKIPPING BYTE-ORDER MARK" (see note 788449)
2016 Mar 04 12:35 PM
Hi Thomas,
Check if file contains BOM depending on the type.
cl_abap_file_utilities=>check_for_bom( l_file ) = cl_abap_file_utilities=>bom_utf16_le.
or
cl_abap_file_utilities=>check_for_bom( l_file ) = cl_abap_file_utilities=>bom_utf8.
if required then you can skip byte-order mark wiht:
OPEN DATASET l_file FOR INPUT IN BINARY MODE AT POSITION 2.
So it will leave 2 two bytes...
Best Regards,
Ferenc
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |