vt-is-UTF8 - check whether current VT is in UTF8- or byte-mode. 检查当前VT是否处于VTF8模式或是字节模式.
总览
vt-is-UTF8 [-h|--help] [-V|--version] [-q|--quiet]
描述
vt-is-UTF8 checks whether the current VT is in UTF8 mode, by writing (and erasing afterwards) a 3-byte-long UTF8 sequence, and looking how much chars where displayed by the console driver. vt-is-UTF8 检查当前VT是否处于 UTF8 模式, 其方式是写(并且随后擦除) 一个 3 字节的 UTF8 序列, 然后察看控制台驱动展示了多少个字符.
A message telling in which mode the console is is then written to stdout (except if the --quiet option was given). 然后会在标准输出上给出一个信息, 指出控制台所用模式(除非给出了 --quiet 选项).
If the --quiet option is not given, the value returned is 1 if an error occurs, else 0. 在有错误发生时, 如果没有选取 --quiet 选项, 返回值将是 1 , 否则将是 0 .
选项
- -h --help
- display version number, a short help message and exit. 展示版本号, 以及一个简短的帮助信息, 然后退出.
- -V --version
- display version number and exit. 展示版本号然后退出.
- -q --quiet
- do not print on stdout in with mode we are, but return the state as exit-status 1 if in UTF8-mode, 0 if in byte-mode. In case of error, 0 is returned and a message is displayed on stderr. 不在标准输出上打印所处模式, 但是返回一个状态, 对于 UTF8 模式该退出状态为 1 , 而对于字节模式该状态为 0 . 如果发生错误, 也返回 0 , 并且送给标准错误一个信息.
BUGS
The check should be done by directly asking the kernel, which is not possible as of kernels 2.0.x. 模式的检查可能应该通过直接请求内核来进行, 但从内核 2.0.x 开始这就不可能了.
As of kernel 2.0.35, the byte-mode is sometimes erroneously detected as UTF8-mode, after switching from a 512-chars font to a 256-chars font. This is probably a console-driver bug. 从 2.0.35 的内核开始, 在做了从 512 字符字体到 256 字符字体的切换后, 字节模式有时会被错误地认为是 UTF8 模式. 这或许就是一个控制台驱动的 bug .
vt-is-UTF8 - check whether current VT is in UTF8- or byte-mode. 检查当前VT是否处于VTF8模式或是字节模式.的更多相关文章
- 响应消息的内容类型 text/html; charset=utf-8 与绑定(application/soap+xml; charset=utf-8)的内容类型不匹配。
问题表述: 响应消息的内容类型 text/html; charset=utf-8 与绑定(application/soap+xml; charset=utf-8)的内容类型不匹配. 说明: 此类问题当 ...
- 解决Qt中文乱码以及汉字编码的问题(UTF-8/GBK)——ubuntu环境设置默认是utf-8,文件编码可使用Encodersoft批量转换
一.Qt环境设置 文件从window上传到Ubuntu后会显示乱码,原因是因为ubuntu环境设置默认是utf-8,Windows默认都是GBK.Windows环境下,Qt Creator,菜单-&g ...
- php header utf8 插入header("Content-type: text/html; charset=utf-8");
PHP文件插入header("Content-type: text/html; charset=utf-8"); 相当于页面里面的<meta http-equiv=" ...
- Linux 环境下 javac 编译错误: 编码UTF8的不可映射字符 (编码UTF8/GBK的不可映射字符)
Linux 系统下一般默认使用UTF-8编码, 使用javac 编辑使用其他编码格式编写的源吗时,会出现 “ 错误: 编码UTF8的不可映射字符 ”. 最近在使用 javac 编译 一个在wind ...
- StreamWriter结合UTF-8编码使用不当,会造成BOM(Byte Order Mark )问题生成乱码(转载)
问: I was using HttpWebRequest to try a rest api in ASP.NET Core MVC.Here is my HttpWebRequest client ...
- [C/C++]_[Unicode转Utf8,Ansi转Unicode,Ansi文件转Utf8文件]
http://blog.csdn.net/infoworld/article/details/15337665 场景: 1.也就只有windows需要那么麻烦,还搞一个ANSI编码.学学mac os ...
- checking it the current os is a 32bit or 64bit version 检查操作系统是32位还是64位
) { Console.WriteLine("32bit os"); } ) { Console.WriteLine("64bit os"); }
- Geeks - Check whether a given graph is Bipartite or not 二分图检查
检查一个图是否是二分图的算法 使用的是宽度搜索: 1 初始化一个颜色记录数组 2 利用queue宽度遍历图 3 从随意源点出发.染色0. 或1 4 遍历这点的邻接点.假设没有染色就染色与这个源点相反的 ...
- EXCEL的导出
具体实现代码: protected void EXCEL_Click(object sender, EventArgs e) { ToExcel(GridView1); } public void T ...
随机推荐
- python面试题之如何用Python找出你目前在哪个目录?
>>> import os >>> os.getcwd() 'C:\Users\lifei\AppData\Local\Programs\Python\Python ...
- Source object main.o has EABI version 0, but target ../../../bin/ad has EABI version 5
编译的时候,遇到了一些问题:Source object main.o has EABI version 0, but target ../../../bin/ad has EABI version 5 ...
- 标准模板库(STL)学习探究之Multimap容器
C++ Multimaps和maps很相似,但是MultiMaps允许重复的元素.(具体用法请参考map容器) 函数列表: begin() 返回指向第一个元素的迭代器 cle ...
- React-Native 指定模拟器RUN-IOS
react-native run-ios --simulator "iPhone 7”
- SQL查询条件生成小工具
最近运维数据,经常遇到需要在sql条件中个In('',''....)个字符串的情况,于是在网上找了个小工具改造一下,先用着: 效果如图: using System; using System.Coll ...
- 算法竞赛模板 动态规划之背包DP
① 01背包 有n件物品和一个容量为v的背包.第i件物品的价值是c[i],体积是w[i].求解将哪些物品装入背包可使价值总和最大. 这是最基础的背包问题,特点是:每种物品仅有一件,可以选择放或不放. ...
- Linux主机名的修改以及配置
查询主机名: [root@localhost ~]# hostnamelocalhost.localdomain [root@localhost ~]# vim /etc/sysconfig/netw ...
- C# 利用发射动态创建泛型类型的对象,泛型类型支持带惨的构造函数
static class Program { static void Main(string[] args) { var aaa = Create<AAA>("aaa" ...
- javac无效问题解决
首先去下载JDK的最新版本,目前应该是1.7,具体下载地址可以百度去搜索下载 步骤阅读 2 下载时候要注意自己系统的版本,JDK分32位和64位版,根据自己系统版本下载. 步骤阅读 3 下载完后安装, ...
- Python爬虫实战——反爬策略之代理IP【无忧代理】
一般情况下,我并不建议使用自己的IP来爬取网站,而是会使用代理IP. 原因很简单:爬虫一般都有很高的访问频率,当服务器监测到某个IP以过高的访问频率在进行访问,它便会认为这个IP是一只"爬虫 ...