2018-04-03 12:19:05 +00:00
[![Deploy to now ](https://deploy.now.sh/static/button.svg )](https://deploy.now.sh/?repo=https://github.com/zeit/next.js/tree/master/examples/custom-charset)
2018-02-06 06:52:31 +00:00
# Custom server example
## How to use
2018-04-03 12:19:05 +00:00
### Using `create-next-app`
Execute [`create-next-app` ](https://github.com/segmentio/create-next-app ) with [Yarn ](https://yarnpkg.com/lang/en/docs/cli/create/ ) or [npx ](https://github.com/zkat/npx#readme ) to bootstrap the example:
```bash
npx create-next-app --example custom-charset custom-charset-app
# or
yarn create next-app --example custom-charset custom-charset-app
```
2018-02-06 06:52:31 +00:00
### Download manually
2018-07-11 21:56:15 +00:00
Download the example:
2018-02-06 06:52:31 +00:00
```bash
curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/custom-charset
cd custom-charset
```
Install it and run:
```bash
npm install
npm run dev
2018-04-03 12:19:05 +00:00
# or
yarn
yarn dev
2018-02-06 06:52:31 +00:00
```
Deploy it to the cloud with [now ](https://zeit.co/now ) ([download](https://zeit.co/download))
```bash
now
```
## The idea behind the example
2018-04-03 12:19:05 +00:00
The HTTP/1.1 specification says - if charset is not set in the http header then the browser defaults use ISO-8859-1.
2018-02-06 06:52:31 +00:00
For languages like Polish, Albanian, Hungarian, Czech, Slovak, Slovene, there will be broken characters encoding from SSR.
You can overwrite Content-Type in getInitialProps. But if you want to handle it as a server side concern, you can use this as an simple example.