更多>
最新下载
24小时阅读排行榜
- 1 PHP 中遍历并输出多维关联数组(如物流追踪 JSON 解析结果)的正确方法
- 2 trae里php的post_max_size怎么设_trae改post大小法【技巧】
- 3 css如何表示无颜色状态_使用transparent关键字
- 4 如何正确更新 React 中视频组件的 controls 属性与 CSS 类名
- 5 如何将嵌套数组按值归类并统计唯一键的数量
- 6 css框架分页组件如何快速使用_通过分页类快速生成导航条
- 7 如何在c++中实现零拷贝(Zero-Copy)数据传输? (网络编程优化)
- 8 javascript如何实现动画效果_requestAnimationFrame有何优势【教程】
- 9 php连接mongodb副本集咋配置_php连mongo副本集教程【步骤】
- 10 php模拟post请求ssl版本_phppostssl版本指定法【技巧】
- 11 Golang责任链模式的应用场景_Golang责任链模式设计
- 12 css布局如何实现网格间距统一_通过 grid gap 或 flex gap 设置
- 13 如何在Mac芯片架构下安装Golang_Golang Apple Silicon安装方案
- 14 php如何判断变量为浮点数_php浮点数判断实现方式【示例】
- 15 如何对XML映射逻辑进行单元测试
更多>
最新教程
-
- Node.js 教程
- 16327 2025-08-28
-
- CSS3 教程
- 1547030 2025-08-27
-
- Rust 教程
- 23445 2025-08-27
-
- Vue 教程
- 25875 2025-08-22
-
- PostgreSQL 教程
- 22378 2025-08-21
-
- Git 教程
- 9326 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
