當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript encoding.encodingExists函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。