# rfc2231

> Encode and decode rfc2231/rfc5987

Latest version **1.3.0** (published 2016-08-04) · BSD license · 0 weekly downloads

## Install

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

## 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.3.0 |
| Published | 2016-08-04 |
| First published | 2015-01-08 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Andreas Lind |
| Maintainers | maartenwinter, papandreou |
| Keywords | rfc2231, rfc6266, mime, email, header, subject, utf-8, non-ascii, iconv |

## Links

- npm: https://www.npmjs.com/package/rfc2231
- Repository: https://github.com/One-com/rfc2231
- Issues: https://github.com/One-com/rfc2231/issues
- npm.io page: https://npm.io/package/rfc2231

## Dependencies (1)

- [iconv-lite](https://npm.io/package/iconv-lite.md) 0.4.5

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2016-08-04
- 1.2.0 — 2015-01-14
- 1.1.1 — 2015-01-09
- 1.1.0 — 2015-01-08
- 1.0.0 — 2015-01-08

## README

rfc2231
=======

Encode and decode [rfc2231](https://www.ietf.org/rfc/rfc2231.txt) (MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations) and [rfc5987](https://www.ietf.org/rfc/rfc5987.txt) (Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters).

```js
var rfc2231 = require('rfc2231');

console.log(rfc2231.unfoldAndDecodeParameters({
    'title*0*': "us-ascii'en'This%20is%20even%20more%20",
    'title*1*': '%2A%2A%2Afun%2A%2A%2A%20',
    'title*2': "is it not?"
});
// {title: "This is even more ***fun*** is it not?"}

console.log(rfc2231.encodeAndFoldParameters({
    foo: '0123456789012345678901234567890123456789012345678901234567890123456789'
});
// {
//   'foo*0': '"012345678901234567890123456789012345678901234567890123456789"',
//   'foo*1': '"0123456789"'
// }

```

`rfc2231.unfoldAndDecodeParameters` takes advantage of the `iconv` module if available, and otherwise falls back to `iconv-lite`.

[![NPM version](https://badge.fury.io/js/rfc2231.png)](http://badge.fury.io/js/rfc2231)
[![Build Status](https://travis-ci.org/One-com/rfc2231.png)](https://travis-ci.org/One-com/rfc2231)
[![Coverage Status](https://coveralls.io/repos/One-com/rfc2231/badge.png)](https://coveralls.io/r/One-com/rfc2231)
[![Dependency Status](https://david-dm.org/One-com/rfc2231.png)](https://david-dm.org/One-com/rfc2231)

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