Files
xterm.js/src/common/services/CharsetService.ts
T
Cursor AgentandDaniel Imms e83102070b Merge common/encoding and common/data into common/base
Move TextDecoder, Charsets, and EscapeSequences into the base layer.
Remove separate encoding and data composite projects; update imports
and explicit project references across common subprojects.

Co-authored-by: Daniel Imms <Tyriar@users.noreply.github.com>
2026-05-30 18:12:34 +00:00

39 lines
881 B
TypeScript

/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/
import { ICharsetService } from 'common/services/Services';
import type { ICharset } from 'common/base/Charsets';
export class CharsetService implements ICharsetService {
public serviceBrand: any;
public charset: ICharset | undefined;
public glevel: number = 0;
private _charsets: (ICharset | undefined)[] = [];
public get charsets(): (ICharset | undefined)[] {
return this._charsets;
}
public reset(): void {
this.charset = undefined;
this._charsets = [];
this.glevel = 0;
}
public setgLevel(g: number): void {
this.glevel = g;
this.charset = this._charsets[g];
}
public setgCharset(g: number, charset: ICharset | undefined): void {
this._charsets[g] = charset;
if (this.glevel === g) {
this.charset = charset;
}
}
}