什么是“\ u001B [J”代表? [英] What does "\u001B[J" represent?

查看:3490
本文介绍了什么是“\ u001B [J”代表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以向我解释一下\ u001B [字符串中的J可能代表什么?我正在将输入字节流转换为ascii字符串。也许该流采用其他编码方式。

Can anyone explain to me what \u001B[J within a string might represent? I'm converting an input byte stream to an ascii string. Perhaps the stream is in some other encoding.

更新:

这是我如何阅读流

inputStreamReader = new InputStreamReader(session.getStdout(), "ASCII");

int length = inputStreamReader.read(buffer);
stringBuilder.append(buffer, 0, length);

// LOG the result
StringEscapeUtils.escapeJava(stringBuilder.toString());


推荐答案

这是Unicode 1B ESC 字符),后跟两个字符 [ J ,许多终端上常见的ANSI转义序列。

That is Unicode 1B (the ESC character), followed by the two characters [ and J, an ANSI escape sequence common on many terminals.

特定的转义序列清除屏幕。其他人可以在这里找到。

That particular one clears the screen. Others can be found here.

这篇关于什么是“\ u001B [J”代表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆