CSV export fails on non-ascii characters

Aperta Adatta ai principianti
#314 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
postgresql, sql
Ambito
database

Direzione di ricerca

Parti dall’azione «Save as CSV» nel riquadro dei risultati e segui il modo in cui scrive i risultati della query nel file selezionato; il report mostra l’errore su Windows quando un risultato contiene caratteri cirillici o kazaki. Riproduci il problema con la query SQL fornita e verifica che il salvataggio riesca e che il CSV contenga tutte le righe con lo stesso testo del riquadro dei risultati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Describe the bug

CSV export fails when the result set contains at least some non-ASCII characters anywhere in it (I work with russian and kazakh languages so I've experienced this issue with letters from those languages) .

The resulting csv file only contains data before the non-ASCII character.

To Reproduce

Steps to reproduce the behavior:

  1. Execute a query that returns rows containing non-ASCII characters:
    select * from (values
    ('ascii-characters'),
    ('А'), ('а'), ('Ә'), ('ә'), ('Б'), ('б'), ('В'), ('в'), ('Г'), ('г'),
    ('Ғ'), ('ғ'), ('Д'), ('д'), ('Е'), ('е'), ('Ё'), ('ё'), ('Ж'), ('ж'),
    ('З'), ('з'), ('И'), ('и'), ('Й'), ('й'), ('К'), ('к'), ('Қ'), ('қ'),
    ('Л'), ('л'), ('М'), ('м'), ('Н'), ('н'), ('Ң'), ('ң'), ('О'), ('о'),
    ('Ө'), ('ө'), ('П'), ('п'), ('Р'), ('р'), ('С'), ('с'), ('Т'), ('т'),
    ('У'), ('у'), ('Ұ'), ('ұ'), ('Ү'), ('ү'), ('Ф'), ('ф'), ('Х'), ('х'),
    ('Һ'), ('һ'), ('Ц'), ('ц'), ('Ч'), ('ч'), ('Ш'), ('ш'), ('Щ'), ('щ'),
    ('Ъ'), ('ъ'), ('Ы'), ('ы'), ('І'), ('і'), ('Ь'), ('ь'), ('Э'), ('э'),
    ('Ю'), ('ю'), ('Я'), ('я')
    ) as kz_alphabet(letter);
    
  2. In the results pane, click "Save as CSV" button and proceed saving the file
  3. See error (popup and in the output pane for the extension):

    Failed to save results. Failed to save vscode-export-test.csv: 'charmap' codec can't encode character '\u0410' in position 0: character maps to <undefined>

  4. Examine the file - it only contains data before non-ASCII characters appear in the query results:

    letter
    ascii-characters

Expected behavior

No error, popup indicating success shown, file contains all data rows, rows content is the same as in the query results pane

VS Code version

Version: 1.142.0 (system setup)
Commit: 6d62b1d5dace93a33b3a6d3eca1317bd5e15bcb1
Date: 2026-10-15T03:02:17Z
Electron: 43.7.7
ElectronBuildId: 15553055
Chromium: 150.0.7871.250
Node.js: 24.21.0
V8: 15.0.245.31-electron.0
@github/copilot: 1.0.95-0.unstable.r38345923974.g3754b70
@github/copilot-sdk: 1.0.19.38345923974.g3754b70
OS: Windows_NT x64 10.0.26200

Extension Logs

[1:21:27 PM] Started saving results to c:\path\to\query\results\vscode-export-test.csv
[1:21:27 PM] Failed to save results. Failed to save vscode-export-test.csv: 'charmap' codec can't encode character '\u0410' in position 0: character maps to

Lingua principale
Nessun dato sulla lingua
Stelle
406
Fork
35
Merge medio
2h 47m
PR unite (30g)
5

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/vscode-pgsql

Tutte le issue di microsoft/vscode-pgsql

Issue simili

Altre issue su Databases

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.