From 8cfd4c323b92560ad8f888189fb411f472963f8e Mon Sep 17 00:00:00 2001 From: Eldorado-ling <150699289+Eldorado-ling@users.noreply.github.com> Date: Thu, 5 Nov 2026 23:59:17 +0800 Subject: [PATCH] docs: preserve UTF-8 in Windows export example --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3eecf6c..ba1f65b 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,21 @@ the Python converter reads only the saved file and contacts no service. ### Step 1: export the session yourself Run this yourself, in the folder where you want the file. Replace -`SESSION_ID` with the session you want to export. If the session lives on a -remote OpenCode server, add the server address as `--server URL`. +`SESSION_ID` with the session you want to export. ```powershell -opencode session export SESSION_ID | Set-Content -Encoding utf8 session.json +cmd /d /c "opencode session export SESSION_ID > session.json" ``` +This Windows command redirects the export as bytes and writes those bytes to +the file unchanged, so the export keeps its UTF-8 encoding even when the +PowerShell console uses another encoding. + +Choose a new output filename in place of `session.json` when you want to keep +an export that is already there. If the session lives on a remote OpenCode +server, add the server address inside the quoted command, after `SESSION_ID`, +as `--server URL`. + The raw export includes session metadata and projected message records, not just visible conversation text. It is not a database or event-history backup; the CLI export omits unfinished assistant, shell and compaction records.