New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

sys-encoding

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sys-encoding

Node.js module to get system encoding.

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
1
Created
Source

sys-encoding

Node.js module to get system encoding.

When executing terminal commands using Node.js, the output results are garbled on some non-English language Windows systems. This library uses the chcp command on Windows to obtain the system encoding, which can then be converted to the corresponding language using the iconv-lite library.

Installation

pnpm add sys-encoding

Usage

import { getSystemEncoding } from 'sys-encoding';
import { decode } from 'iconv-lite';

const encoding = getSystemEncoding();
console.log(decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), encoding)); // If encoding is 'win1251'

Keywords

chcp

FAQs

Package last updated on 28 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts