redhat-developer / redhat-developer/vscode-java
Is there any way for the terminal used by vscode to recognize the input Greek letters
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 547
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
This is a problem I saw on stack overflow.
OP have the following code:
`public static void main(String[] args) throws Exception {
System.setProperty("file.encoding","UTF-8");
System.out.println("File encoding is " + System.getProperty("file.encoding"));
Scanner console = new Scanner(new InputStreamReader(System.in, StandardCharsets.UTF_8));
PrintStream sysout = new PrintStream(System.out, true, StandardCharsets.UTF_8);
sysout.println("\nTests:");
sysout.println("Can we print lambda using unicode? Let's see: \u03BB");
sysout.print("Copy and paste the lambda above here: ");
String line = console.nextLine();
sysout.println("\nThe input consisted of " + line.length() + " character(s).");
sysout.println("The input was: " + line);
if (line.equals("λ")) {
sysout.println("lambda (λ) was detected with .equals!");
} else {
sysout.println("lambda (λ) was not detected with .equals.");
}
printHexOfString("Hex of λ", "λ");
printHexOfString("Hex of input", line);
}
private static void printHexOfString(String title, String str) {
StringBuilder stringBuilder = new StringBuilder();
char[] charArray = str.toCharArray();
for (char c : charArray) {
String charToHex = Integer.toHexString(c);
stringBuilder.append(charToHex);
}
System.out.println(title+ ": "+stringBuilder.toString());
}`
OP means that when he is using eclipse, the terminal of eclipse can recognize the input“ λ ".
When using vscode, we know that VScode using the CMD shell of windows, the Greek letters cannot be recognized (Greek letters are copied and pasted into the input box).
I tried different ISO charsets like 437 869 65001 936, but it didn't work.
Some of them can recognize "λ" as any other letter, but the other recognize "λ" as "".
Is there any way for the terminal used by vscode to recognize the input Greek letters?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用 Windows CMD 和列出的编码在 VS Code 终端中复现 Java 代码片段,并将粘贴的 λ 与 Eclipse 的终端进行比较。检查 repository 是否有终端或编码入口点;该 issue 没有提供要针对的文件或测试。完成意味着确定一种受支持的方式来识别输入,或记录没有任何 repository 更改可以提供这种方式。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java, vscode
- 领域
- cli, developer-experience, operating-systems
- Issue 类型
- 缺陷
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 20/100