Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/virtualFileSystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,12 @@ export class SQLiteFileSystemProvider implements vsc.FileSystemProvider {
// Try to decode as UTF-8
try {
// We strictly try to decode as UTF-8. If the content contains invalid UTF-8 sequences,
// the TextDecoder with { fatal: true } will throw, and we will fall back to treating it as a BLOB.
// This allows saving text containing null bytes (which are valid in UTF-8/SQL TEXT)
// the TextDecoder with 'fatal: true' will throw, and we will fall back to treating it as a BLOB.
// This allows saving text containing null bytes, which are valid in UTF-8/SQL TEXT,
// while correctly handling actual binary data.
value = new TextDecoder('utf-8', { fatal: true }).decode(content);
} catch {
// Keep as Uint8Array (BLOB)
// Keep as Uint8Array, treating as BLOB
}

await document.databaseOperations.updateCell(table, rowIdNum, column, value);
Expand Down