mirror of
https://github.com/akitaonrails/ai-memory.git
synced 2026-10-02 03:24:46 +08:00
macOS /bin/sh is bash 3.2, which sign-extends bytes >= 0x80 in printf "'c", so ai_memory_url_encode sent 0xC3 as %FFFFFFFFFFFFFFC3. Any accented cwd, workspace or project name reached the server as a different string. Read the byte with %d and add 256 when it comes back negative. Adds a test with an accented macOS path; with the existing UTF-8 test it fails on macOS sh before the fix. All 254 non-NUL, non-newline single bytes now match Python's urllib.parse.quote under dash and macOS sh.