Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't support Chinese GBK encoding #127

Open
nopdan opened this issue Jan 29, 2023 · 9 comments
Open

Don't support Chinese GBK encoding #127

nopdan opened this issue Jan 29, 2023 · 9 comments

Comments

@nopdan
Copy link

nopdan commented Jan 29, 2023

Don't support Chinese GBK encoding. It always seems to use utf-8 encoding.

@mechatroner
Copy link
Owner

Hello! Could you please clarify this? The extension itself is encoding-oblivious it deals with the JS strings decoded by the editor. So if VSCode supports GBK, then Rainbow CSV should "support" it too. Or are you talking about RBQL?

@nopdan
Copy link
Author

nopdan commented Jan 30, 2023

Hello! Could you please clarify this? The extension itself is encoding-oblivious it deals with the JS strings decoded by the editor. So if VSCode supports GBK, then Rainbow CSV should "support" it too. Or are you talking about RBQL?

If rainbow csv does not take effect, it can be opened normally. After 1 second, it becomes garbled.
1

@mechatroner
Copy link
Owner

Thank you for the demo! Did you try to manually switch the encoding to "GBK" by clicking on the encoding button at the bottom? what happens in that case? Does this still happen with other extensions disabled?
Could you also please attach a file here that could be used to reproduce the problem? Thanks!

@nopdan
Copy link
Author

nopdan commented Jan 30, 2023

I've tried it and it's very effective.
092.txt

@mechatroner
Copy link
Owner

mechatroner commented Jan 30, 2023

Thanks! I did some tests with your file and in my case VSCode always opens it with UTF-8 encoding no matter if Rainbow CSV is enabled or not. But if I manually switch the encoding to GBK it fixes the characters and it works with Rainbow CSV too. So I don't think that Rainbow CSV is causing this issue, moreover extensions do not have capability to initiate encoding switch: microsoft/vscode#824.

@nopdan
Copy link
Author

nopdan commented Jan 30, 2023

Thanks! I did some tests with your file and in my case VSCode always opens it with UTF-8 encoding no matter if Rainbow CSV is enabled or not. But if I manually switch the encoding to GBK it fixes the characters and it works with Rainbow CSV too. So I don't think that Rainbow CSV is causing this issue, moreover extensions do not have capability to initiate encoding switch: microsoft/vscode#824.

In my case, when I disable Rainbow CSV extension it becomes normal. Do you set the files.autoGuessEncoding to true?

@nopdan
Copy link
Author

nopdan commented Jan 30, 2023

Thanks! I did some tests with your file and in my case VSCode always opens it with UTF-8 encoding no matter if Rainbow CSV is enabled or not. But if I manually switch the encoding to GBK it fixes the characters and it works with Rainbow CSV too. So I don't think that Rainbow CSV is causing this issue, moreover extensions do not have capability to initiate encoding switch: microsoft/vscode#824.

I turned off all the extensions except Rainbow CSV and the problem continued. The question seems to be rainbow_csv.enable_separator_autodetection. How does Rainbow CSV detect separator?

@mechatroner
Copy link
Owner

Sorry for the late reply, I was able to reproduce the problem with files.autoGuessEncoding. I will take a look at it later when I have more time, thanks again for the bug report!

@mechatroner
Copy link
Owner

Looks like this is actually related to an issue in the VSCode itself see microsoft/vscode#39084 and microsoft/vscode#127936. And actually, it is possible to reproduce the problem even with Rainbow CSV disabled - if you switch the file type of your file to e.g. 'C++' in the bottom right corner, not only file type would change but encoding too and garble the characters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants