亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

首頁 PHP 函式庫 其它類別庫 ANSI轉(zhuǎn)為HTML5函式庫
ANSI轉(zhuǎn)為HTML5函式庫
<?php
namespace SensioLabs\AnsiConverter\Tests;
use SensioLabs\AnsiConverter\AnsiToHtmlConverter;
class AnsiToHtmlConverterTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @dataProvider getConvertData
     */
    public function testConvert($expected, $input)
    {
        $converter = new AnsiToHtmlConverter();
        $this->assertEquals($expected, $converter->convert($input));
    }
    public function getConvertData()
    {
        return array(
            // text is escaped
            array('<span style="background-color: black; color: white">foo <br /></span>', 'foo <br />'),
            // newlines are preserved
            array("<span style=\"background-color: black; color: white\">foo\nbar</span>", "foo\nbar"),
            // backspaces
            array('<span style="background-color: black; color: white">foo   </span>', "foobar\x08\x08\x08   "),
            array('<span style="background-color: black; color: white">foo</span><span style="background-color: black; color: white">   </span>', "foob\e[31;41ma\e[0mr\x08\x08\x08   "),
            // color
            array('<span style="background-color: darkred; color: darkred">foo</span>', "\e[31;41mfoo\e[0m"),
            // color with [m as a termination (equivalent to [0m])
            array('<span style="background-color: darkred; color: darkred">foo</span>', "\e[31;41mfoo\e[m"),
            // bright color
            array('<span style="background-color: red; color: red">foo</span>', "\e[31;41;1mfoo\e[0m"),
            // carriage returns
            array('<span style="background-color: black; color: white">foobar</span>', "foo\rbar\rfoobar"),
            // underline
            array('<span style="background-color: black; color: white; text-decoration: underline">foo</span>', "\e[4mfoo\e[0m"),
            // non valid unicode codepoints substitution (only available with PHP >= 5.4)
            PHP_VERSION_ID < 50400 ?: array('<span style="background-color: black; color: white">foo '."\xEF\xBF\xBD".'</span>', "foo \xF4\xFF\xFF\xFF"),
        );
    }
}

ANSI是一種字元代碼,為使電腦支援更多語言,通常使用 0x00~0x7f 範(fàn)圍的1 個位元組來表示 1 個英文字元。超出此範(fàn)圍的使用0x80~0xFFFF來編碼,即擴展的ASCII編碼。

HTML則是超文本標(biāo)記語言,標(biāo)準(zhǔn)通用標(biāo)記語言下的一個應(yīng)用。 「超文本」是指頁面內(nèi)可以包含圖片、鏈接,甚至音樂、程式等非文字元素。超文本標(biāo)記語言的結(jié)構(gòu)包括「頭」部分(英文:Head)、和「主體」部分(英


免責(zé)聲明

本站所有資源皆由網(wǎng)友貢獻或各大下載網(wǎng)站轉(zhuǎn)載。請自行檢查軟體的完整性!本站所有資源僅供學(xué)習(xí)參考。請不要將它們用於商業(yè)目的。否則,一切後果都由您負(fù)責(zé)!如有侵權(quán),請聯(lián)絡(luò)我們刪除。聯(lián)絡(luò)方式:admin@php.cn

相關(guān)文章

如何使用 Python 的 MySQLdb 函式庫安全地轉(zhuǎn)義 MySQL 資料庫的字串? 如何使用 Python 的 MySQLdb 函式庫安全地轉(zhuǎn)義 MySQL 資料庫的字串?

07 Dec 2024

Python 中 MySQL 連接的轉(zhuǎn)義字串當(dāng)使用資料庫時,管理複雜的字串可能具有挑戰(zhàn)性,特別是當(dāng)它...

為什麼標(biāo)準(zhǔn) C 函式庫缺少整數(shù)求冪函數(shù) (pow(int, int))? 為什麼標(biāo)準(zhǔn) C 函式庫缺少整數(shù)求冪函數(shù) (pow(int, int))?

24 Oct 2024

本文討論了 C 標(biāo)準(zhǔn)函式庫中缺少 pow(int, int) 函數(shù)的原因。它探討了歷史原因,包括 C 語言的遺產(chǎn)、其他功能的機會成本以及限制

為什麼要從 Python 中的「object」繼承:一個類別繼承問題 為什麼要從 Python 中的「object」繼承:一個類別繼承問題

24 Dec 2024

了解 Python 類別繼承在 Python 中,類別可以從其他類別繼承,這使它們能夠存取父類別的屬性並...

如何在 Linux 上建立和使用動態(tài)共用 C 類別庫? 如何在 Linux 上建立和使用動態(tài)共用 C 類別庫?

05 Dec 2024

在 Linux 上建立和使用動態(tài)共用 C 類別庫建立共用類別庫要建立共用 C 類別庫,您可以依照...

為什麼無法在字段初始化程序中初始化非靜態(tài)字段? 為什麼無法在字段初始化程序中初始化非靜態(tài)字段?

03 Jan 2025

了解欄位初始化問題在您的程式碼中,您有一個儲存庫類別 (DinnerRepository) 和一個服務(wù)類別 (Service),它使用...

如何在 NetBeans 中設(shè)定 Java 專案的類別路徑? 如何在 NetBeans 中設(shè)定 Java 專案的類別路徑?

07 Dec 2024

在 NetBeans 中設(shè)定類別路徑在 NetBeans 中使用 Java 時,您可能需要調(diào)整類別路徑以包含其他程式庫或 JAR...

See all articles