# utf8-to-win1251

> Converts unicode text to windows-1251

Latest version **1.0.3** (published 2022-08-08) · ISC license · 0 weekly downloads

## Install

```sh
npm install utf8-to-win1251
pnpm add utf8-to-win1251
yarn add utf8-to-win1251
bun add utf8-to-win1251
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2022-08-08 |
| First published | 2022-08-08 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 28 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Gergely Horvath |
| Maintainers | gregor.horvath |
| Keywords | convert, text, unicode, utf8, to, windows-1251, win1251 |

## Links

- npm: https://www.npmjs.com/package/utf8-to-win1251
- Repository: https://github.com/GregorHorvatH/utf8-to-win1251
- Issues: https://github.com/GregorHorvatH/utf8-to-win1251/issues
- npm.io page: https://npm.io/package/utf8-to-win1251

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2022-08-08
- 1.0.2 — 2022-08-08
- 1.0.1 — 2022-08-08
- 1.0.0 — 2022-08-08

## README

## Installation

Via [npm](https://www.npmjs.com/):

```bash
npm install utf8-to-win1251
```

Via [yarn](https://yarnpkg.com/):

```bash
yarn add utf8-to-win1251
```

In a browser or in [Node.js](https://nodejs.org/):

```js
import unicodeToWin1251 from 'utf8-to-win1251';
```

## API

This function takes a plain text string (the `input` parameter) and encodes it according to windows-1251. The return value is an environment-agnostic `Uint16Array` of which each element represents an octet as per windows-1251.

```js
import unicodeToWin1251 from 'utf8-to-win1251';
import saveAs from 'save-as';

const win1251Array = unicodeToWin1251('Доброго дня!');
const blob = new Blob([win1251Array], {
  type: 'text/plain;charset=windows-1251',
});

saveAs(blob, 'test-file.txt');
```

![text editor example of windows-1251 converted text](./example.png 'text editor example of windows-1251 converted text')

---
_Source: https://npm.io/package/utf8-to-win1251 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
