07_Real_Data — the eight ways it goes wrong at work¶
Level: 201 · for SAP and interface work
Everything before this chapter is mechanism. This chapter is the eight shapes the mechanism takes on the way to or from somebody else's system: a code page named by number, mojibake that can or cannot be reversed, a BOM at the top of a CSV, a field measured in bytes, a record whose layout is not written in the file, the 32 bytes where two tables disagree, the second byte at the end of every Windows line, and a list of names that no two locales agree how to order. Each page reproduces the damage in Python so it can be checked, and says what the ABAP side is doing in prose.
| # | Lesson | The question it answers | Status |
|---|---|---|---|
| 1 | SAP code pages | What are 1100, 1160, 4110 and 4103, and how do I reproduce an interface's mojibake outside SAP? | written, 2026-09-07 |
| 2 | Mojibake round trip | When can damaged text be repaired, and when is the data gone? | written, 2026-09-07 |
| 3 | A BOM in a CSV | Why is my first column named ID? |
written, 2026-09-05 |
| 4 | Fixed-width byte fields | Why does a 10-byte field hold five Polish letters, and how do I truncate without cutting one in half? | written, 2026-09-07 |
| 5 | Packing a record | Where is a binary record's layout written down, and what happens when the two ends disagree? | written, 2026-09-08 |
| 6 | Windows-1252 vs Latin-1 | Why is the text almost right except for € and the quotes? |
written, 2026-09-07 |
| 7 | CRLF vs LF | Where do the ^Ms come from? |
written, 2026-09-07 |
| 8 | Sorting and collation | Why does sorted() put Łódź after Zebra, and which locale is right? |
written, 2026-09-07 |
(ABAP claims on these pages are prose — CI cannot run ABAP — and the Python reproduction beside each one is the checked half.)