Skip to main content
Module

x/accepts/mod.ts>Accepts#charsets

Higher level content negotiation for Deno.
Very Popular
Latest
method Accepts.prototype.charsets
import { Accepts } from "https://deno.land/x/accepts@2.1.1/mod.ts";

Return accepted charsets or best fit based on charsets.

Given Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5 an array sorted by quality is returned:

['utf-8', 'utf-7', 'iso-8859-1']

Parameters

optional
charsets: string[]

Returns

string[] | string | false