fix: support reopen with encoding in browser build.#79232
fix: support reopen with encoding in browser build.#79232LeuisKen wants to merge 1 commit intomicrosoft:masterfrom LeuisKen:master
Conversation
Change-Id: I6b79a00edd96b0d9aaa7d7fef247f1a4db22a707
|
Thanks, but applying this patch results in an error on my end when I try it out.
We will eventually support encodings in the web but currently I do not think I would accept a PR to resolve this. Thanks for the suggested change, but I will close this and revisit once we get there. |
|
I opened #79275 for discussion. |
Well, it's my fault that didn't notice the incoming value should be
Actually I just want to report this bug as a pre-release user. 😂 |
What do you mean? When I change to utf-8 I still get this error:
|
| } | ||
|
|
||
| toString(): string { | ||
| toString(encoding: string = 'uft8'): string { |
There was a problem hiding this comment.
I'm so stupid to let utf8 be uft8.....
There is no excuse for this stupid mistake.......
There was a problem hiding this comment.
@LeuisKen Why don't you just fix this typo and force push to your branch...

Hello, I've try the browser (or your call it web) build of vscode and it's awesome !
But I find some problems with "Reopen with Encoding", I've to work with some
gbkencoded files but the browser build only supportsutf8, so I write this patch to fix this problem and it can handle the readFile case.However, to make it works on writeFile case, I need to import a third-party lib called
text-encodingto handle the encoding ofgbkstrings since the standardTextEncoderAPI only support theutf8encoding format. I don't know whether it's appropriate to import this library in vscode. So I just commit the readFile case patch in this pull request.If you accept my solution for the writeFile case, I will commit the patch of it in this pull request.
Thanks for your work and waiting for your reply.
: )