本文整理汇总了TypeScript中vs/base/node/encoding.encodingExists函数的典型用法代码示例。如果您正苦于以下问题:TypeScript encodingExists函数的具体用法?TypeScript encodingExists怎么用?TypeScript encodingExists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了encodingExists函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: test
test('resolve terminal encoding (environment)', async function () {
process.env['VSCODE_CLI_ENCODING'] = 'utf16le';
const enc = await encoding.resolveTerminalEncoding();
assert.ok(encoding.encodingExists(enc));
assert.equal(enc, 'utf16le');
});
开发者ID:DonJayamanne,项目名称:vscode,代码行数:7,代码来源:encoding.test.ts
示例2: constructor
constructor(config: IRawSearch, walker: FileWalker) {
this.rootFolders = config.rootFolders;
this.extraFiles = config.extraFiles;
this.walker = walker;
this.contentPattern = strings.createRegExp(config.contentPattern.pattern, config.contentPattern.isRegExp, config.contentPattern.isCaseSensitive, config.contentPattern.isWordMatch, true);
this.isCanceled = false;
this.limitReached = false;
this.maxResults = config.maxResults;
this.worked = 0;
this.total = 0;
this.fileEncoding = encodingExists(config.fileEncoding) ? config.fileEncoding : UTF8;
}
开发者ID:578723746,项目名称:vscode,代码行数:12,代码来源:textSearch.ts
示例3: getEncodingForResource
private getEncodingForResource(resource: uri, preferredEncoding?: string): string {
let fileEncoding: string;
const override = this.getEncodingOverride(resource);
if (override) {
fileEncoding = override; // encoding override always wins
} else if (preferredEncoding) {
fileEncoding = preferredEncoding; // preferred encoding comes second
} else {
fileEncoding = this.textResourceConfigurationService.getValue(resource, 'files.encoding'); // and last we check for settings
}
if (!fileEncoding || !encoding.encodingExists(fileEncoding)) {
fileEncoding = encoding.UTF8; // the default is UTF 8
}
return fileEncoding;
}
开发者ID:joelday,项目名称:vscode,代码行数:18,代码来源:encoding.ts
示例4:
return encoding.resolveTerminalEncoding().then(enc => {
assert.ok(encoding.encodingExists(enc));
assert.equal(enc, 'utf16le');
});
开发者ID:AllureFer,项目名称:vscode,代码行数:4,代码来源:encoding.test.ts
示例5:
encoding.resolveTerminalEncoding().then(encoding => {
assert.ok(encodingExists(encoding));
assert.equal(encoding, 'utf16le');
done();
}, done);
开发者ID:AlexxNica,项目名称:sqlopsstudio,代码行数:5,代码来源:encoding.test.ts
注:本文中的vs/base/node/encoding.encodingExists函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论