1.0.6 • Published 2 years ago

urldecode-latin1 v1.0.6

Weekly downloads
6
License
MIT
Repository
github
Last release
2 years ago

npm version Dependencies devDependencies Status

urldecode for latin1 / ISO-8859-1

aka: Percent-encoding or URL-encoding

The standard methods "decodeURI" or "querystring" can't decode latin1 chars like %DF (ß), this decoder can.

How it works: replace latin1 encodings with its utf-8 counterpart, than use querystring (node.js).

Features

  • Decode string and Buffer
  • TODO: encoding

Install

npm install urldecode-latin1

Usage

const urldecodeLatin1 = require('urldecode-latin1')

// from string
let stringEncoded = "k=%61%AE%DF%FF"
let stringDecoded = urldecodeLatin1(inputString) // => {k: 'a®ßÿ'}


// from buffer (when input has un-encoded latin1 chars)
let bufferEncoded = Buffer.from([0x6B, 0x3D, 0xDF])
let stringDecoded = urldecodeLatin1(b) // => { k: 'ß' }

Contributing / Development

Style

https://github.com/standard/standard

Testing

Run mocha tests:

npm test

Check code coverage (creates "./coverage/index.html"):

npm run-script cover

1.0.6

2 years ago

1.0.5

3 years ago

1.0.4

4 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago