CLAUDE.ai answer: The short answer: use STON toJsonString: obj (no Pretty). It produces compact JSON on a single line with zero line feeds: STON toJsonString: (Dictionary new at: 'foo' put: 1; at: 'bar' put: #(1 2 3); yourself) "=> '{"foo":1,"bar":[1,2,3]}'" Verified byte-level â the output contains no 0x0A (LF) bytes. Why toJsonStringPretty: is flaky for tests. It's a one-liner that delegates to STON jsonWriter with prettyPrint: true. The writer's newline character is set in STONWriter>>initialize: newLine := OSPlatform current lineEnding. So you get LF on macOS/Linux and CRLF on Windows â different expected strings per platform. That's the real source of the pain. If you actually want pretty output but deterministic line endings, build the writer yourself and call newLine: explicitly (it takes any string â CR, LF, CRLF, or even ''): String streamContents: [ :out | ((STON jsonWriter on: out) prettyPrint: true; newLine: String lf; yourself) nextPut: object ] STONWriter>>newLine: is a public accessor, and newlineIndent just writes whatever string you set, so passing String cr, String crlf, or '' all work. I confirmed it by reading STONWriter>>newLine:, newlineIndent, and dumping raw bytes from a pretty run with newLine: String cr â got byte 13, no byte 10. So, for test stability, the two clean answers for the pharo list are: 1. Use `STON toJsonString:` â compact, no newlines, no platform drift. 2. Or configure the writer: `(STON jsonWriter on: s) prettyPrint: true; newLine: String lf; ...` â pretty, but with a line ending you pick instead of the OS default. The base image only ships STON for JSON (no NeoJSON installed), so these are the relevant knobs. ----- Original message ----- From: stephane ducasse via Pharo-users <pharo-users@lists.pharo.org> To: Any question about pharo is welcome <pharo-users@lists.pharo.org> Cc: stephane ducasse <stephane.ducasse@inria.fr> Subject: [Pharo-users] JSON without lf? Date: Friday, April 10, 2026 6:54 AM Hi I would like to know if there is a way to generate JSON without lf? toJsonStringPretty: is generating lf and this is painful for tests. S.