Extracting plain text from RTF without breaking Turkish
RTF does not store text as UTF-8. Non-ASCII characters are written as \'hh escapes — a single byte in whatever code page the document declares with \ansicpg. Strip the markup with a regular expression and you keep those bytes but lose the code page, so Turkish characters decode against the wrong table and "Tanı" comes out as "Taný".
This converter reads the declared code page and decodes the byte runs against it, which is why Turkish survives. It also accumulates consecutive escapes before decoding, so a multi-byte character in a legacy code page is not split into two wrong ones.
Where the document declares no code page at all, the tool says so and states which one it assumed, rather than guessing silently. You can override the choice if you know the source.
Which code page do Turkish RTF files use?
- Usually cp1254 (Windows Turkish). Files produced by older Delphi or Office versions on a Turkish Windows install often declare it; some declare cp1252 by mistake, which is exactly the case where overriding helps.
Does it keep formatting?
- No — the output is plain text by design. Bold, tables and colours are dropped; line breaks and paragraph boundaries are preserved.