更多>
最新下载
24小时阅读排行榜
- 1 Go语言测试文件如何命名_Go测试文件规范说明
- 2 Golang应用如何接入日志收集系统_日志采集对接方案
- 3 php怎样删除数组元素_php删除数组元素函数区别【删除】
- 4 mysql中列级权限控制与数据库安全
- 5 如何在Linux使用包管理器安装Golang_Golang apt与yum安装方式对比
- 6 如何在Golang中实现RPC调用_RPC调用流程与实现方式
- 7 PHP怎么用ZStackAI云平台_布容器环境调模型服务获响应【捷法】
- 8 css 浮动元素换行异常怎么办_clear both 或 flex 替代 float
- 9 css 选择器写得太多难维护怎么办_减少层级使用语义 class
- 10 c++中如何实现堆排序_c++ heap算法与堆排序代码【实例】
- 11 XML数据岛是什么 如何在HTML页面中嵌入XML数据
- 12 mysql安装后配置远程访问权限的步骤
- 13 css 动画与弹性效果_通过 ease-out 创建弹跳动画效果
- 14 EF Core怎么实现Contains查询 EF Core列表In查询方法
- 15 Go反射是什么_Go反射机制与基本概念解析
更多>
最新教程
-
- Node.js 教程
- 15539 2025-08-28
-
- CSS3 教程
- 1544741 2025-08-27
-
- Rust 教程
- 22817 2025-08-27
-
- Vue 教程
- 25294 2025-08-22
-
- PostgreSQL 教程
- 21865 2025-08-21
-
- Git 教程
- 8882 2025-08-21
下载首页 / 类库下载 / 其它类库
<?php
/*
* This file is part of ansi-to-html.
*
* (c) 2013 Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SensioLabs\AnsiConverter;
use SensioLabs\AnsiConverter\Theme\Theme;
/**
* Converts an ANSI text to HTML5.
*/
class AnsiToHtmlConverter
{
protected $theme;
protected $charset;
protected $inlineStyles;
protected $inlineColors;
protected $colorNames;
public function __construct(Theme $theme = null, $inlineStyles = true, $charset = 'UTF-8')
{
$this->theme = null === $theme ? new Theme() : $theme;
$this->inlineStyles = $inlineStyles;
$this->charset = $charset;
$this->inlineColors = $this->theme->asArray();
$this->colorNames = array(
'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white',
'', '',
'brblack', 'brred', 'brgreen', 'bryellow', 'brblue', 'brmagenta', 'brcyan', 'brwhite',
);ANSI是一种字符代码,为使计算机支持更多语言,通常使用 0x00~0x7f 范围的1 个字节来表示 1 个英文字符。超出此范围的使用0x80~0xFFFF来编码,即扩展的ASCII编码。
为使计算机支持更多语言,通常使用 0x80~0xFFFF 范围的 2 个字节来表示 1 个字符。比如:汉字 '中' 在
ANSI编码
ANSI编码
中文操作系统中,使用 [0xD6,0xD0] 这两个字节存储。
不同的国家和地区制定了不同的标准,由此产生了 GB2312、GBK、GB18030、Big5、Shift_JIS 等各自的编码标准。这些使用多个字节来代表一个字符的各种汉字延伸编码方式,称为 ANSI 编码。在简体中文Windows操作系统中,ANSI 编码代表 GBK 编码;在繁体中文Windows操作系统中,ANSI编码代表Big5;在日文Windows操作系统中,ANSI 编码代表 Shift_JIS 编码。
不同 ANSI 编码之间互不兼容,当信息在国际间交流时,无法将属于两种语言的文字,存储在同一段 ANSI 编码的文本中。
ANSI编码表示英文字符时用一个字节,表示中文用两个或四个字节。
本站所有资源都是由网友投搞发布,或转载各大下载站,请自行检测软件的完整性!本站所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!如有侵权请联系我们删除下架,联系方式:admin@php.cn
