decode-uri-component-charset
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

decode-uri-component-charset Build Status

Decode URI Component with Charset such as 'euc-kr' without tears.

  • Typescript support
  • Tiny package size

Install

$ npm install decode-uri-component-charset
or
$ yarn add decode-uri-component-charset

Usage

Basic

import { decodeURIComponentCharset } from 'decode-uri-component-charset';
// or const { decodeURIComponentCharset } = require('decode-uri-component-charset');
 
const euckr = '%C5%D7%BD%BA%C6%AE';
// '테스트' < This word.
// Encoded URI with UTF-8 '%ED%85%8C%EC%8A%A4%ED%8A%B8'
// Encoded URI with EUC-KR '%C5%D7%BD%BA%C6%AE'
 
decodeURIComponent(euckr);
// Uncaught URIError: URI malformed
 
const result = decodeURIComponentCharset(euckr, 'euc-kr');
 
console.log(result);
 // '테스트'

Input

EncodedURI String

Type: String

Charset

Charset string based on iconv-lite.
Type: String

Output

DecodedURI String

Type: String

Recommend Libraries

  • React Checklist - Make Checkbox List Easy and Simple with React Hooks.
  • React Store - React Hook Store with useContext and useReducer for State Management.
  • React Quilljs - React Hook Wrapper for Quill(Rich Text Editor).

Maintainer

License

MIT

Dependencies (1)

Dev Dependencies (6)

Package Sidebar

Install

npm i decode-uri-component-charset

Weekly Downloads

235

Version

1.0.0

License

MIT

Unpacked Size

4.75 kB

Total Files

7

Last publish

Collaborators

  • gtgalone