How to use windows-1251 - 9 common examples

To help you get started, we’ve selected a few windows-1251 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / windows-1251 / windows-1251-tests.ts View on Github external
import * as windows1251 from 'windows-1251';

var text:string = "some text", byteString:string, decodedText:string;

var version:string = windows1251.version;

var labels:string[] = windows1251.labels;
 
byteString = windows1251.encode(text);
byteString = windows1251.encode(text, { mode: 'html' });
byteString = windows1251.encode(text, { mode: 'fatal' });

decodedText = windows1251.decode(byteString);
decodedText = windows1251.decode(byteString, { mode: 'fatal' });
decodedText = windows1251.decode(byteString, { mode: 'replacement' });
github nikityy / rutracker-api / tests / utils.js View on Github external
readMockPage: name => {
    const string = fs
      .readFileSync(`./tests/mocks/${name}.html`)
      .toString("binary");
    const html = windows1251.decode(string, { mode: "html" });

    return html;
  }
};
github DefinitelyTyped / DefinitelyTyped / windows-1251 / windows-1251-tests.ts View on Github external
import * as windows1251 from 'windows-1251';

var text:string = "some text", byteString:string, decodedText:string;

var version:string = windows1251.version;

var labels:string[] = windows1251.labels;
 
byteString = windows1251.encode(text);
byteString = windows1251.encode(text, { mode: 'html' });
byteString = windows1251.encode(text, { mode: 'fatal' });

decodedText = windows1251.decode(byteString);
decodedText = windows1251.decode(byteString, { mode: 'fatal' });
decodedText = windows1251.decode(byteString, { mode: 'replacement' });
github DefinitelyTyped / DefinitelyTyped / windows-1251 / windows-1251-tests.ts View on Github external
import * as windows1251 from 'windows-1251';

var text:string = "some text", byteString:string, decodedText:string;

var version:string = windows1251.version;

var labels:string[] = windows1251.labels;
 
byteString = windows1251.encode(text);
byteString = windows1251.encode(text, { mode: 'html' });
byteString = windows1251.encode(text, { mode: 'fatal' });

decodedText = windows1251.decode(byteString);
decodedText = windows1251.decode(byteString, { mode: 'fatal' });
decodedText = windows1251.decode(byteString, { mode: 'replacement' });
github DefinitelyTyped / DefinitelyTyped / windows-1251 / windows-1251-tests.ts View on Github external
import * as windows1251 from 'windows-1251';

var text:string = "some text", byteString:string, decodedText:string;

var version:string = windows1251.version;

var labels:string[] = windows1251.labels;
 
byteString = windows1251.encode(text);
byteString = windows1251.encode(text, { mode: 'html' });
byteString = windows1251.encode(text, { mode: 'fatal' });

decodedText = windows1251.decode(byteString);
decodedText = windows1251.decode(byteString, { mode: 'fatal' });
decodedText = windows1251.decode(byteString, { mode: 'replacement' });
github DefinitelyTyped / DefinitelyTyped / windows-1251 / windows-1251-tests.ts View on Github external
import * as windows1251 from 'windows-1251';

var text:string = "some text", byteString:string, decodedText:string;

var version:string = windows1251.version;

var labels:string[] = windows1251.labels;
 
byteString = windows1251.encode(text);
byteString = windows1251.encode(text, { mode: 'html' });
byteString = windows1251.encode(text, { mode: 'fatal' });

decodedText = windows1251.decode(byteString);
decodedText = windows1251.decode(byteString, { mode: 'fatal' });
decodedText = windows1251.decode(byteString, { mode: 'replacement' });
github DefinitelyTyped / DefinitelyTyped / windows-1251 / windows-1251-tests.ts View on Github external
import * as windows1251 from 'windows-1251';

var text:string = "some text", byteString:string, decodedText:string;

var version:string = windows1251.version;

var labels:string[] = windows1251.labels;
 
byteString = windows1251.encode(text);
byteString = windows1251.encode(text, { mode: 'html' });
byteString = windows1251.encode(text, { mode: 'fatal' });

decodedText = windows1251.decode(byteString);
decodedText = windows1251.decode(byteString, { mode: 'fatal' });
decodedText = windows1251.decode(byteString, { mode: 'replacement' });
github nikityy / rutracker-api / rutracker-api.js View on Github external
res.on('data', function(x) {
        data = data + windows1251.decode(x, {mode: 'html'});
      });
      res.on('end', function() {
github nikityy / rutracker-api / lib / utils.js View on Github external
decodeWindows1251: string =>
    windows1251.decode(string.toString("binary"), { mode: "html" }),

windows-1251

A robust windows-1251 encoder/decoder written in JavaScript.

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis