# CSV with fields in Portuguese

**URL:** <https://discuss.elastic.co/t/csv-with-fields-in-portuguese/168683>\
**Category:** Logstash\
**Created:** [February 16, 2019, 1:05pm UTC](https://discuss.elastic.co/t/csv-with-fields-in-portuguese/168683 "2019-02-16T13:05:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ssasporta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssasporta/32/13695_2.png) [@ssasporta](https://discuss.elastic.co/u/ssasporta)\
**Post date:** [February 16, 2019, 1:05pm UTC](https://discuss.elastic.co/t/csv-with-fields-in-portuguese/168683/1 "2019-02-16T13:05:29Z")

</div>

I have a csv file with some of the fields in **Portuguese**.

In the input of logstash I wrote: `codec => plain { charset=>"UTF-8" }`

**I am getting the following warnings:**

`[2019-02-16T14:38:25,876][WARN][logstash.codecs.plain] Received an event that has a different character encoding than you configured. {:text=>"INC000569147,Designado,COPM do Brasil,Produ\\xE7\\xE3o,Triagem Back End,2019-01-21 07:00:38,,,,\\r", :expected_charset=>"UTF-8"}`

**I tried to solve it in the filter with ruby:**

```
 ruby {
        code => "
                 unless (event.get('Classification').to_s).nil?
                      event.set('Classification', ((event.get('Classification')).to_s).force_encoding('ISO-8859-1'))
                 end
                 unless (event.get('Organization Support Group').to_s).nil?
                      event.set('Organization Support Group', ((event.get('Organization Support Group')).to_s).force_encoding('ISO-8859-1'))
                 end
                 unless (event.get('Designated Group').to_s).nil?
                      event.set('Designated Group', ((event.get('Designated Group')).to_s).force_encoding('ISO-8859-1'))
                 end
        "
 }

```

**but I am still getting the same warnings.**

Any better Idea how to solve it?

Regards,  
Sharon.

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 16, 2019, 2:08pm UTC](https://discuss.elastic.co/t/csv-with-fields-in-portuguese/168683/2 "2019-02-16T14:08:04Z")

</div>

> [@ssasporta](#):
>
> Produ\xE7\xE3o[...]", :expected\_charset=\>"UTF-8"

Produção? E7 E3 is not UTF-8, UTF-8 would be \xC3\xA7\xC3\xA3. It might be ASCII-8BIT.

---

<div class="post-metadata">

**Author:** ![ssasporta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ssasporta/32/13695_2.png) [@ssasporta](https://discuss.elastic.co/u/ssasporta)\
**Post date:** [February 16, 2019, 4:13pm UTC](https://discuss.elastic.co/t/csv-with-fields-in-portuguese/168683/3 "2019-02-16T16:13:12Z")

</div>

I did it and all the warnings stop.

I can still see some gibberish:

`Designated Group Monitora��o Neg�cio`

The real value is: **Monitoração Negócio**

He isn't able to present the Portuguese special characters.

Thanks  
Sharon.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 16, 2019, 4:13pm UTC](https://discuss.elastic.co/t/csv-with-fields-in-portuguese/168683/4 "2019-03-16T16:13:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
