Giter Club home page Giter Club logo

Comments (5)

lhecker avatar lhecker commented on June 19, 2024

I'd love to help but can you please write more about what you mean? Ideas:

  • Are you trying to remotely connect to a Windows or Linux system?
  • How are you trying to switch the encoding?
  • What exactly breaks?
  • Can you give us steps so that we can reproduce your issue?

from terminal.

stdmkmehp avatar stdmkmehp commented on June 19, 2024

I'm try to remotely connect to a Linux system which has env LC_ALL=C. When I do shell cmd with "cat file", the terminal shows garbled characters. The file is encoded with gbk,but it seams that terminal shows as utf-8.
To reproduce the issue, you can cat file_enc_with_gbk.txt. On my terminal, it comes with
image
Obviously it is not what i want.

I have used Xshell before, which can provide a dropdown menu to switch the terminal's encoding. If the file is encode with gbk, I just need switch the terminal's encoding to gbk. If the file is encode with utf-8, I just need switch the terminal's encoding to utf-8. Buf the Windows terminal seems take a default encoding utf-8, and do not support to switch.

file_enc_with_gbk.txt

from terminal.

lhecker avatar lhecker commented on June 19, 2024

I'm try to remotely connect to a Linux system which has env LC_ALL=C.

LC_ALL=C in practice tells your system that you want to use ASCII. At a minimum, I would recommend setting it to zh_CN.UTF-8 if possible, or some other variant, to get Unicode support. Of course there's also zh_CN.GBK if you really need GBK encoding anywhere, but I'd recommend against using GKB long term, because it's not Unicode which makes exchanging text difficult.

Buf the Windows terminal seems take a default encoding utf-8, and do not support to switch.

Not quite. You're right in that we don't support switching the encoding (codepage) via a setting. #15678 tracks this feature request. I think it makes sense for us to have such a setting, because Gnome Terminal, Apple's Terminal, and many others got it as well.

However, I believe your issue is because Windows' OpenSSH doesn't support switching the encoding. See here: PowerShell/Win32-OpenSSH#1855 (comment) I can't imagine that this is an inherent limitation and I'm pretty sure support for other encodings could be added to OpenSSH. However, such work doesn't seem to be currently planned.

from terminal.

carlos-zamora avatar carlos-zamora commented on June 19, 2024

Thanks for filing! Regarding what Leonard said above, we're going to close this as a /dup of PowerShell/Win32-OpenSSH#1855.

from terminal.

microsoft-github-policy-service avatar microsoft-github-policy-service commented on June 19, 2024

Hi! We've identified this issue as a duplicate of one that exists on somebody else's Issue Tracker. Please make sure you subscribe to the referenced external issue for future updates. Thanks for your report!

from terminal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.