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

Feature Request: Character Set translation #10870

Closed
doggy8088 opened this issue Aug 4, 2021 · 6 comments
Closed

Feature Request: Character Set translation #10870

doggy8088 opened this issue Aug 4, 2021 · 6 comments
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. Product-Terminal The new Windows Terminal.

Comments

@doggy8088
Copy link

Description of the new feature/enhancement

In PuTTY, there is a convenient feature called Character set translation. See below:

image

Sometimes we have to deal with some files or programs that can only deal with non-unicode characters. In Windows Terminal, it can only deal with UTF-8 character set. This limitation will lead us unable to deal with that kind of situations.

Proposed technical implementation details (optional)

@doggy8088 doggy8088 added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Aug 4, 2021
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Aug 4, 2021
@zadjii-msft zadjii-msft added the Product-Terminal The new Windows Terminal. label Aug 4, 2021
@DHowett
Copy link
Member

DHowett commented Aug 5, 2021

I'm curious about your specific use case. Windows Terminal uses the Windows console host to handle all of its translation, and that supports all of the codepages and data encodings that the Windows console has always supported. For example, this does work:

#include <windows.h>
int main() {
	SetConsoleOutputCP(932);
	WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), "\xA6", 1, nullptr, nullptr);
	return 0;
}

image

0xA6 is the Shift-JIS encoding (notably: not UTF-8!) for that glyph.

@DHowett DHowett added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 5, 2021
@DHowett
Copy link
Member

DHowett commented Aug 5, 2021

(Which application are you using that is not functioning properly without the ability to switch the encoding?)

@doggy8088
Copy link
Author

@DHowett I can reproduce the problem I met.

  1. Login into any Linux

    $ lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 20.04.2 LTS
    Release:        20.04
    Codename:       focal
  2. Download a file encoded in Big5 charset.

    curl https://blog.miniasp.com/big5-example.txt -o big5-example.txt
  3. Simply cat it out. It can't display correctly.

    image

  4. If I change it to UTF-8, then all okay!

    image

  5. I also tried to change LANG and LC_ALL, still not working.

    image

@ghost ghost added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Aug 6, 2021
@doggy8088
Copy link
Author

I also tried luit to translate big5 to utf8, but it looks weird. For the same command, I can run correctly from x-terminal in elementary OS. It probably Windows Terminal's issue.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:        20.04
Codename:       focal
$ locale -a
C
C.UTF-8
POSIX
en_US.utf8
zh_HK.utf8
zh_TW
zh_TW.big5
zh_TW.utf8
$ cat big5-example.txt | iconv -f big5 -t utf8
測試
$ luit -encoding big5 cat big5-example.txt
4z8U
$ LC_ALL=zh_TW.big5 luit cat big5-example.txt
4z8U
$ LC_ALL=zh_TW.big5 luit -encoding big5 cat big5-example.txt
4z8U

image

@carlos-zamora carlos-zamora added this to the Icebox ❄ milestone Nov 2, 2022
@carlos-zamora carlos-zamora added Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Attention The core contributors need to come back around and look at this ASAP. Needs-Tag-Fix Doesn't match tag requirements labels Nov 2, 2022
@zadjii-msft
Copy link
Member

Hey I'm trying to reconcile this with #1802, #15678, et. al. I feel like we may have missed an important note:

Login into any Linux

how are you logging in? WSL? ssh.exe? ssh in WSL? Sommething else?

@zadjii-msft zadjii-msft added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Aug 23, 2023
@microsoft-github-policy-service
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@microsoft-github-policy-service microsoft-github-policy-service bot added the No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. label Aug 27, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot removed this from the Icebox ❄ milestone Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Related to output processing (inserting text into buffer, retrieving buffer text, etc.) Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something No-Recent-Activity This issue/PR is going stale and may be auto-closed without further activity. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

4 participants