总览

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模式或是字节模式.的更多相关文章

  1. 响应消息的内容类型 text/html; charset=utf-8 与绑定(application/soap+xml; charset=utf-8)的内容类型不匹配。

    问题表述: 响应消息的内容类型 text/html; charset=utf-8 与绑定(application/soap+xml; charset=utf-8)的内容类型不匹配. 说明: 此类问题当 ...

  2. 解决Qt中文乱码以及汉字编码的问题(UTF-8/GBK)——ubuntu环境设置默认是utf-8,文件编码可使用Encodersoft批量转换

    一.Qt环境设置 文件从window上传到Ubuntu后会显示乱码,原因是因为ubuntu环境设置默认是utf-8,Windows默认都是GBK.Windows环境下,Qt Creator,菜单-&g ...

  3. php header utf8 插入header("Content-type: text/html; charset=utf-8");

    PHP文件插入header("Content-type: text/html; charset=utf-8"); 相当于页面里面的<meta http-equiv=" ...

  4. Linux 环境下 javac 编译错误: 编码UTF8的不可映射字符 (编码UTF8/GBK的不可映射字符)

    Linux 系统下一般默认使用UTF-8编码, 使用javac 编辑使用其他编码格式编写的源吗时,会出现  “ 错误: 编码UTF8的不可映射字符 ”. 最近在使用  javac 编译 一个在wind ...

  5. 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 ...

  6. [C/C++]_[Unicode转Utf8,Ansi转Unicode,Ansi文件转Utf8文件]

    http://blog.csdn.net/infoworld/article/details/15337665 场景: 1.也就只有windows需要那么麻烦,还搞一个ANSI编码.学学mac os ...

  7. checking it the current os is a 32bit or 64bit version 检查操作系统是32位还是64位

    ) { Console.WriteLine("32bit os"); } ) { Console.WriteLine("64bit os"); }

  8. Geeks - Check whether a given graph is Bipartite or not 二分图检查

    检查一个图是否是二分图的算法 使用的是宽度搜索: 1 初始化一个颜色记录数组 2 利用queue宽度遍历图 3 从随意源点出发.染色0. 或1 4 遍历这点的邻接点.假设没有染色就染色与这个源点相反的 ...

  9. EXCEL的导出

    具体实现代码: protected void EXCEL_Click(object sender, EventArgs e) { ToExcel(GridView1); } public void T ...

随机推荐

  1. dubbo的一些特性理解一下

    还有 启动检查.负载均衡.多协议支持 等 待总结

  2. Set 对象和WeakSet对象

    Set对象是值的集合,你可以按照插入的顺序迭代它的元素. Set中的元素只会出现一次,即 Set 中的元素是唯一的,一种有效去重方式. , , , , ]); console.log(set1.has ...

  3. Python之lambda && reduce

    lambda类似于C里面的#define或者C++里面的内联函数(inline),一般都小巧精悍 >>> g=lambda x,y:x*y >>> g(3,7) 2 ...

  4. 在命令行中插入TAB键

    参考man bash: quoted-insert (C-q, C-v) Add the next character typed to the line verbatim.  This is how ...

  5. Android多线程:深入分析 Handler机制源码(二)

    前言 在Android开发的多线程应用场景中,Handler机制十分常用 接下来,深入分析 Handler机制的源码,希望加深理解 目录 1. Handler 机制简介 定义一套 Android 消息 ...

  6. 【记录】安装mysql Install/Remove of the Service Denied!错误的解决办法

    最近安装 Mysql 5.6版本,在安装的过程中出现Install/Remove of the Service Denied!错误!(本人Win10 系统) 出现此问题是由于当前用户权限不够,需要以管 ...

  7. linux学习总结--linux100day(day1)

    写在前面:我是一名在学习linux的小学生,最近在学习python时,我的老师推荐了github上的一本教材“python100day”,100day里面的内容由浅入深,且都具备详细的例子,对于我这个 ...

  8. celery使用多队列

    生产者: 文件1: 定义任务 #!/usr/bin/env python3 # coding: utf-8 from celery import Celery import settings pw = ...

  9. linux常用命令记录(一)

    文件搜索命令 grep在文件中查找字符并输出 grep 字符或字符串 文件目录 grep pub /teach/.txt -c 字符出现总行数 grep .txt -n 行号 grep .txt -i ...

  10. TypeError: Object of type 'int32' is not JSON serializable

    将模型用flask封装,返回json时报错:TypeError: Object of type 'int32' is not JSON serializable 网上搜索出的解决方案:重写json.J ...