# utf7

> Converts text to and from UTF-7 (RFC 2152 and IMAP)

Latest version **1.0.2** (published 2016-09-01) · 0 weekly downloads

## Install

```sh
npm install utf7
pnpm add utf7
yarn add utf7
bun add utf7
```

## 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.2 |
| Published | 2016-09-01 |
| First published | 2011-06-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Konstantin Käfer |
| Maintainers | kkaefer |

## Links

- npm: https://www.npmjs.com/package/utf7
- npm.io page: https://npm.io/package/utf7

## Dependencies (1)

- [semver](https://npm.io/package/semver.md) ~5.3.0

## Recent versions

- 1.0.2 (latest) — 2016-09-01
- 1.0.1 — 2016-08-31
- 1.0.0 — 2011-06-12

## README

# UTF-7

[![CircleCI](https://circleci.com/gh/kkaefer/utf7.svg?style=svg)](https://circleci.com/gh/kkaefer/utf7)

Encodes and decodes JavaScript (Unicode/UCS-2) strings to UTF-7 ASCII strings. It supports two modes: UTF-7 as defined in [RFC 2152](http://tools.ietf.org/html/rfc2152) and Modified UTF-7 as defined by the IMAP standard in [RFC 3501, section 5.1.3](http://tools.ietf.org/html/rfc3501#section-5.1.3)

## Usage

**RFC 2152**

```javascript
var utf7 = require('utf7');

var encoded = utf7.encode('Jyväskylä');
assert.equal('Jyv+AOQ-skyl+AOQ-', encoded);

var decoded = utf7.decode(encoded);
assert.equal('Jyväskylä', decoded);
```

By default, `.encode()` only encodes the default characeters defined in RFC 2152. To also encode optional characters, use `.encodeAll()` or specify the characters you want to encode as the second argument to `.encode()`.

**IMAP (RFC 3501)**

```javascript
var utf7 = require('utf7').imap;

var encoded = utf7.encode('"你好" heißt "Hallo"');
assert.equal('"&T2BZfQ-" hei&AN8-t "Hallo"', encoded);

var decoded = utf7.decode(encoded);
assert.equal('"你好" heißt "Hallo"', decoded);
```

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