Solution : https://service.sap.com/sap/support/notes/788449 (SAP Service marketplace login required)
Summary :
This SAP Note addresses issues with ABAP file handling where UTF-8 encoded files are not properly detected or handled, especially concerning Byte Order Marks (BOMs). The class CL_ABAP_FILE_UTILITIES contains methods like CHECK_FOR_BOM and CHECK_UTF8 to identify file encodings and manage BOMs effectively. Usage of 'OPEN DATASET ... IN TEXT MODE ENCODING UTF-8' with specific position adjustments is advised to skip BOMs. Additionally, methods for creating UTF-8 files with BOMs and managing UTF-16 files using alternative methods are detailed, with insights into the support packages providing these functionalities.
Key words :
byte sequence ef bb bf, text mode encoding utf-8, read dataset statement reads, skipping byte-order mark, utf-8 byte-order mark, byte-order mark, abap program creates, communication partner expects, statement open dataset, open dataset statement
Related Notes :
| 1375438 | Globalization Collection Note |
| 1319517 | Unicode Collection Note |
| 1038151 | Legacy files in LSMW: BOM for UTF-8 not possible |
| 910857 | Incorrect characters (#) in batch input session |
| 863392 | RFBIBL00: The first record is not a session record |
| 855495 | RFBIDE00 / RFBIKR00: First record is not a session record |
| 752835 | Usage of the file interfaces in Unicode systems |
| 747615 | Tool for converting files from one code page to another |
| 27 | Recommendations for the ABAP file interface |