How to use the windows-1251.version function in windows-1251

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' });

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