code wiki / _hdl_build / nx_book_mojibake_e2e_gate.nx
nx_book_mojibake_e2e_gate.nx
buildroot/runtime/_hdl_build/nx_book_mojibake_e2e_gate.nx
about
nx_book_mojibake_e2e_gate.nx -- END-TO-END liar-kill gate for the library mojibake fix, through the REAL
compiled nx_epub_book.elf (not a unit). Builds a valid EPUB whose CHAPTER BODY + TITLE carry raw Windows-1252
bytes -- the curly apostrophe 0x92 ("there<0x92>s"), the em-dash 0x97 -- alongside a ’ numeric ref and a
GENUINE UTF-8 apostrophe (E2 80 99) to prove idempotency end-to-end. Runs the extractor, then reads the emitted
chap0.txt + book.json and asserts: the smart-punctuation arrived as clean UTF-8, NO raw 0x92/0x97 survived, and
NO U+FFFD (EF BF BD) was produced. This is the operator's exact "there<>s" bug, proven fixed on a real book.
Sovereign: opc_write builds the epub, fork/exec runs the extractor, no shell. expect_exit: 0 license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_opc.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 11 | func e_p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 12 | func e_n(v0: i64) -> i64 { var v: i64=v0; if v<0 { sys_write(1,"-" as *u8,1); v=0-v } let b: *u8=sys_mmap(24); var k: i64=0; if v==0 {b[0]=48 as u8;k=1} while v>0 {b[k]=(48+(v%10)) as u8; v=v/10; k=k+1} let o: *u8=sys_mmap(24); var j: i64=0; while j<k {o[j]=b[k-1-j];j=j+1} sys_write(1,o,k); return 0 } |
| 13 | func e_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 14 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: main |
| 17 | func has3(buf: *u8, n: i64, a: i64, b: i64, c: i64) -> i64 |
| 23 | func has1(buf: *u8, n: i64, a: i64) -> i64 { var i: i64=0; while i < n { if (buf[i]&0xff)==a { return 1 } i=i+1 } return 0 } |
| 26 | func run2(path: *u8, a0: *u8, a1: *u8, redir: *u8) -> i64 |
| 41 | func main() -> i64 |