npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lppedd/kotlinx-charset

v0.3.0

Published

Minimal support for charset encoding and decoding

Readme

maven central npm kotlin build license

Changelog

See CHANGELOG.md.

Supported Kotlin platforms

All Kotlin platforms are supported, except for Android Native.

Design considerations

kotlinx-charset aims to be straightforward for existing JDK consumers.
It replicates parts of the JDK's Charset API, albeit with more restrictions.

The core types you will work with are:

  • XCharset - describes a character set
  • XCharsetDecoder - decodes a byte sequence into characters
  • XCharsetEncoder - encodes characters into a byte sequence
  • XCharsetRegistrar - a registry and lookup service for obtaining XCharset instances

core

The core module provides the foundational components for implementing and registering new charsets.

// Create an empty charset registry
private val registrar = XCharsetRegistrar()

// Register a new charset
registrar.registerCharset(YourCharset())

// Retrieve and use a charset
val charset = registrar.getCharset("YourCharsetName")
val decoder = charset.newDecoder()
val encoder = charset.newEncoder()

ebcdic

The ebcdic module adds support for:

IBM037  IBM930   IBM1144
IBM273  IBM937   IBM1146
IBM278  IBM939   IBM1147
IBM277  IBM1047  IBM1390
IBM280  IBM1141  IBM1399
IBM285  IBM1142
IBM297  IBM1143

You can register supported EBCDIC charsets to your XCharsetRegistrar via the provideCharsets function.

import com.lppedd.kotlinx.charset.ebcdic.provideCharsets as provideEbcdicCharsets

// Your shared charset registry
private val registrar = XCharsetRegistrar()

provideEbcdicCharsets(registrar)

exported

The exported module allows JS consumers to decode bytes and encode strings, using top-level functions exported from ECMAScript modules.

[!TIP]
Avoid using this module when consuming kotlinx-charset from a Kotlin project

You can depend on the @lppedd/kotlinx-charset npm package.
For example, consuming the library from TypeScript would look like:

import { decode, encode, getCharset } from "@lppedd/kotlinx-charset";

function funsExample(bytes: Uint8Array): Uint8Array {
  const str = decode("ibm037", bytes);
  return encode("ibm037", str);
}

// Alternatively, you can interact with a charset instance directly.
// This allows setting or removing (by passing null) the replacement character.
function instanceExample(bytes: Uint8Array): Uint8Array {
  const charset = getCharset("ibm037");

  const decoder = charset.newDecoder();
  const str = decoder.decode(bytes);

  const encoder = charset.newEncoder();
  return encoder.encode(str);
}

Both the decode and encode functions will throw an Error if the specified charset does not exist or if an error occurs during data processing.

License

MIT License 2025-present Edoardo Luppi