Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
function utfEncode
Re-export
import { utfEncode } from "https://deno.land/x/simple_utility@v0.4.2/mod.universal.ts";

Convert from string to UTF-8 binary.

Examples

Example 1

const text = "HelloWorld!";
const converted = utfEncode(text);
const restored = utfDecode(converted);

Parameters

data: string

Returns

Uint8Array