vscode_rainbow_csv
vscode_rainbow_csv copied to clipboard
Bad encoding leads to unaligned cells
When the file you opened has chars that are badly encoded in it, the alignment will shift as if that char does not exist at all.
For example, the following string was saved with ANSI (Windows 1252) encoding:
This,is,a,header,with,°,bad,chars,°,sprinkled,throughout,
,,,,,,,,,,,
,,,,,,,,,,,
After opening it in VSCode, the default settings will try to open the file as UTF-8:
Obviously the real problem is opening the file with the wrong encoding, but trying to align the table regardless, because sometimes you just don't care if a single symbol is decoded correctly, the alignment will be off after each bad char:
While the problem does not start with the extension, maybe there is still a way to detect the bad char questionmark �
during counting for alignment as well.
Thanks for reporting. I agree that this is an issue, and this might actually be a special case of a more general problem, see #69
You are right, I thought it was an issue of the > not being counted when padding other cells, but showing whitespace reveals that > just does not adhere to the fixed with font width like your referenced issue.
Well this is a difficult one to fix then.. Would need to add whitespace of a fixed width of the same size as the non-standard size character then..