---
name: "Mojolicious::Plugin::Charset"
section: "3pm"
platform: "linux"
package: "libmojolicious-perl"
version: "5.54+dfsg-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/Mojolicious::Plugin::Charset"
---

# Mojolicious::Plugin::Charset(3pm)

Charset plugin

## NAME

Mojolicious::Plugin::Charset - Charset plugin

## SYNOPSIS

```
  # Mojolicious
  $self->plugin(Charset => {charset => 'Shift_JIS'});
  # Mojolicious::Lite
  plugin Charset => {charset => 'Shift_JIS'};
```

## DESCRIPTION

Mojolicious::Plugin::Charset is a plugin to easily set the default charset and encoding on all layers of Mojolicious.

The code of this plugin is a good example for learning to build new plugins, you're welcome to fork it.

See "PLUGINS" in Mojolicious::Plugins for a list of plugins that are available by default.

## OPTIONS

Mojolicious::Plugin::Charset supports the following options.

### charset

```
  # Mojolicious::Lite
  plugin Charset => {charset => 'Shift_JIS'};
```

Application charset.

## METHODS

Mojolicious::Plugin::Charset inherits all methods from Mojolicious::Plugin and implements the following new ones.

### register

```
  $plugin->register(Mojolicious->new, {charset => 'Shift_JIS'});
```

Register hook "before\_dispatch" in Mojolicious in application and change a few defaults.

## SEE ALSO

Mojolicious, Mojolicious::Guides, \<http://mojolicio.us\>.
