# Character encoding problems

**URL:** https://discuss.elastic.co/t/character-encoding-problems/126714
**Category:** Logstash
**Created:** [April 4, 2018, 10:25am UTC](https://discuss.elastic.co/t/character-encoding-problems/126714 "2018-04-04T10:25:14Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)
#### Post date: [April 5, 2018, 9:18pm UTC](https://discuss.elastic.co/t/character-encoding-problems/126714/4 "2018-04-05T21:18:53Z")

</div>

One thing to note. The codec `charset` directive is not a "to" operation, it is a "from" operation. In Logstash, the "to" charset is always UTF-8.

Logstash does not have universal charset detection so it needs to know what charset the strings are encoded in to be able to convert them to UTF-8.

When I run your config without the jdbc output I get:

```auto
input {
  stdin {
    codec => plain { charset=>"UTF-8" }
  }
}
output {
  stdout { codec => rubydebug }
}

```

result:

```auto
{
      "@version" => "1",
          "host" => "Elastics-MacBook-Pro.local",
    "@timestamp" => 2018-04-05T20:50:16.143Z,
       "message" => "fühlen"
}

```

From [this SO post](https://stackoverflow.com/a/17849333/5349531) you could try `locale charmap` to see what the charset for the vm is, or for a more realistic test the exec input.

```auto
input {
  exec {
    command => "locale charmap"
    interval => 3600
  }
}
output {
  stdout { codec => rubydebug }
}

```

---

_[View the full topic](https://discuss.elastic.co/t/character-encoding-problems/126714)._
