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

Open file with specific encoding/charset #5294

Closed
a1994846931931 opened this issue May 29, 2019 · 2 comments
Closed

Open file with specific encoding/charset #5294

a1994846931931 opened this issue May 29, 2019 · 2 comments
Labels
editor issues related to the editor enhancement issues that are enhancements to current functionality - nice to haves

Comments

@a1994846931931
Copy link
Contributor

Description

Problem

Using UTF-8 all-the-time is truly a relief. But in reality, it happens that the source files are not encoded in UTF-8 and it looks bad then opened in theia. An example is shown below:

image

The screenshot comes from a file that is encoded in GB 2312. And the garbled line is supposed to be a comment in Chinese.

Solution of Visual Studio Code

There seems to be a solution on vscode where I found this on the right bottom window:

image

After clicking this, two commands pumped up:

image

Executing the first command, I got this:

image

which is really nice because everything works fine after I chose the recommended encoding. I couldn't find anything related on theia, not even a setting. I could have, of course, re-encoded all my files into UTF-8, but the way how vscode does this is just more elegant.

In the End

If there happens to be some other way to set the encoding/charset on theia, please tell me. If not, it will be really nice to have the feature on theia in some later version.

Reproduction Steps

None

OS and Theia version:
OS: Linux
Version: 0.6.0

Diagnostics:
None

a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 6, 2019
…default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
@a1994846931931
Copy link
Contributor Author

I have made some progress on this issue, and I want to show you two demos. The first one shows the ability to change encoding for the current editor. The other one shows the ability to set the default encoding from the configurations.

encoding-support-demo-1

encoding-support-demo-2

a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 6, 2019
…default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 6, 2019
…default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 6, 2019
…guration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 6, 2019
…guration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
@akosyakov akosyakov added editor issues related to the editor enhancement issues that are enhancements to current functionality - nice to haves labels Jun 6, 2019
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 11, 2019
…guration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 11, 2019
…guration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 12, 2019
…guration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 12, 2019
…figuration for default encoding; 3. save file in a specific encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 13, 2019
…. configuration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
@a1994846931931
Copy link
Contributor Author

”Save with encoding" command supported:

  1. save with encoding (unchanged file)
    encoding-support-demo-3

  2. save with encoding (dirty file)
    encoding-support-demo-4

a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 14, 2019
…. configuration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Jun 20, 2019
…. configuration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Aug 2, 2019
…. configuration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Aug 9, 2019
…. configuration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
a1994846931931 added a commit to a1994846931931/theia that referenced this issue Aug 9, 2019
…. configuration for default encoding;

Signed-off-by: Cai Xuye <a1994846931931@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor issues related to the editor enhancement issues that are enhancements to current functionality - nice to haves
Projects
None yet
Development

No branches or pull requests

2 participants