本文整理汇总了TypeScript中utf8.decode函数的典型用法代码示例。如果您正苦于以下问题:TypeScript decode函数的具体用法?TypeScript decode怎么用?TypeScript decode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了decode函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
/// <reference path="./quoted-printable.d.ts" />
/// <reference path="../utf8/utf8.d.ts" />
import * as quotedPrintable from "quoted-printable";
import * as utf8 from "utf8";
quotedPrintable.version === "0.2.1";
quotedPrintable.encode(utf8.encode("foo=bar"));
quotedPrintable.encode(utf8.encode("IĂÂątĂÂŤrnĂ¢tiĂ´nĂ lizĂÂŚtiønâËĆðŸâŠ"));
utf8.decode(quotedPrintable.decode("foo=3Dbar"));
utf8.decode(quotedPrintable.decode("I=C3=B1t=C3=ABrn=C3=A2ti=C3=B4n=C3=A0liz=C3=A6ti=C3=B8n=E2=98=83=F0=9F=92=\r\n=A9"));
示例2:
import * as base64 from 'base-64';
import * as utf8 from 'utf8';
let text = 'foo Š bar đ baz';
let bytes = utf8.encode(text);
let encoded = base64.encode(bytes);
// â 'Zm9vIMKpIGJhciDwnYyGIGJheg=='
encoded = 'Zm9vIMKpIGJhciDwnYyGIGJheg==';
bytes = base64.decode(encoded);
text = utf8.decode(bytes);
const version = base64.version;
示例3: test_decode
function test_decode(): void {
utf8.decode("\xC2\x49");
utf8.decode("\xF0\x90\x80\x81");
}
示例4: function
_.utf8Decode = function (str: string): string {
return utf8.decode(str);
};