Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Ms932.Encoder

import { Ms932 } from "https://raw.githubusercontent.com/i-xi-dev/ms932-encoder.es/2.1.7/mod.ts"; 

const { Encoder } = Ms932;

Windows-31J text encoder

@example
const encoder = new Ms932.Encoder();

encoder.encode("あいうえお");
// → Uint8Array[ 0x82, 0xA0, 0x82, 0xA2, 0x82, 0xA4, 0x82, 0xA6, 0x82, 0xA8 ]

const bytes = new Uint8Array(10);
const { read, written } = encoder.encodeInto("あいうえお", bytes);
// → read: 5
//   written: 10
//   bytes: Uint8Array[ 0x82, 0xA0, 0x82, 0xA2, 0x82, 0xA4, 0x82, 0xA6, 0x82, 0xA8 ]
class Encoder {
constructor(options?: EncoderOptions);
}

§Constructors

§
new Encoder(options?: EncoderOptions)
[src]
@param options
  • The options for Ms932.Encoder.