CSV export fails on non-ascii characters

オープン 初心者向け
#314 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
postgresql, sql
領域
database

調査の方向性

結果ペインの「Save as CSV」アクションから始め、クエリ結果を選択したファイルに書き込む仕組みをたどってください。報告では、結果にキリル文字またはカザフ語の文字が含まれると Windows で失敗するとされています。提供された SQL クエリで再現し、保存が成功し、CSV に結果ペインと同じテキストですべての行が含まれることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
言語のデータがありません
スター
406
フォーク
35
平均マージ
2時間 47分
マージ済み PR(30日)
5

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/vscode-pgsql のほかの issue

microsoft/vscode-pgsql の issue をすべて見る

似ている issue

Databases の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。