Tables containing multi-byte characters are displayed incorrectly in the CLI on Windows
What happens?
The number of spaces in the header line appears to be different between Windows and Linux.
On Linux

On Windows

To Reproduce
It can be reproduced by reading the following CSV.
a,b
文字,文字
select * from read_csv('test.csv', header=True, columns={'a':'varchar', 'b':'varchar'});
OS:
Windows
DuckDB Version:
v0.5.0 109f932c4
DuckDB Client:
CLI
Full Name:
SHIMA Tatsuya
Affiliation:
parsonal
Have you tried this on the latest master branch?
- [X] I agree
Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?
- [X] I agree
try another font
As @l1t1 mentioned, it looks like you are not using a fixed-width font in your shell on Windows. Either switch to a fixed-width font, or use a different display mode that is not dependent on DuckDB knowing rendering sizes (e.g. .mode columns or .mode csv). Detecting the font used in the shell and adjusting rendering based on that is out of scope for the project.
Thanks for your answer. Sorry for the confusion, but the top and bottom are drawn with exactly the same font and terminal (Windows Terminal). It's not the font difference, it's the spacing number difference.
Ah, you are correct. The problem is that we are not using linenoise on Windows and fallback to using SQLite's rendering which does not correctly account for unicode characters.
I opened a similar issue https://github.com/duckdb/duckdb/issues/2546
It seems already fixed in the latest version (v0.6.1)?
Yes, this should be fixed as part of the duckbox render mode.
Awesome! That works very nicely, thanks!