nexus/cli
Volodymyr Kartavyi 057e3a494c fix: ensure embedded PostgreSQL databases use UTF-8 encoding
On macOS, `initdb` defaults to SQL_ASCII encoding because it infers
locale from the system environment. When `ensurePostgresDatabase()`
creates a database without specifying encoding, the new database
inherits SQL_ASCII from the cluster. This causes string functions like
`left()` to operate on bytes instead of characters, producing invalid
UTF-8 when multi-byte characters are truncated.

Two-part fix:
1. Pass `--encoding=UTF8 --locale=C` via `initdbFlags` to all
   EmbeddedPostgres constructors so the cluster defaults to UTF-8.
2. Explicitly set `encoding 'UTF8'` in the CREATE DATABASE statement
   with `template template0` (required because template1 may already
   have a different encoding) and `C` locale for portability.

Existing databases created with SQL_ASCII are NOT automatically fixed;
users must delete their local `data/db` directory and restart to
re-initialize the cluster.

Relates to #636

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 21:59:02 +01:00
..
src fix: ensure embedded PostgreSQL databases use UTF-8 encoding 2026-03-11 21:59:02 +01:00
CHANGELOG.md chore: release v0.3.0 2026-03-09 16:31:12 -05:00
esbuild.config.mjs Remove legacy OpenClaw adapter and keep gateway-only flow 2026-03-07 18:50:25 -06:00
package.json feat(adapters): add Gemini CLI local adapter support 2026-03-10 16:46:04 +00:00
tsconfig.json Fix root TypeScript solution config 2026-03-09 14:09:30 -05:00
vitest.config.ts feat(cli): add client commands and home-based local runtime defaults 2026-02-20 07:10:58 -06:00