rfc2231

1.3.0 • Public • Published

rfc2231

Encode and decode rfc2231 (MIME Parameter Value and Encoded Word Extensions: Character Sets, Languages, and Continuations) and rfc5987 (Character Set and Language Encoding for Hypertext Transfer Protocol (HTTP) Header Field Parameters).

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 Build Status Coverage Status Dependency Status

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.0
    7,257
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.3.0
    7,257
  • 1.2.0
    48
  • 1.1.1
    12
  • 1.1.0
    2
  • 1.0.0
    2

Package Sidebar

Install

npm i rfc2231

Weekly Downloads

6,012

Version

1.3.0

License

BSD

Last publish

Collaborators

  • maartenwinter
  • papandreou