Tehreer/SheenBidi ? reverse-engineered prompt
Reverse engineered prompt
Build me a small C library for handling bidirectional text in Unicode.
I want it to take text in UTF 8, UTF 16, or UTF 32, figure out the reading direction correctly, split text into paragraphs and lines, and give me the ordered runs back so mixed Arabic, Hebrew, and English text displays the right way. It should also detect mirrored characters and help with script runs for text shaping.
Please make it lightweight, fast, thread safe, and easy to use from other C and C plus plus projects. Include a simple public API, a working example, and tests that cover common bidi cases. Set it up so it can be built with both CMake and Meson, and installed cleanly as a reusable library. If you need to, look up the current Unicode bidirectional rules online so the behavior matches the spec closely.
Are you gonna build this?
make sure you review the code using coderabbit