# 'utf8' codec can't decode byte 0xff in position 0: invalid start byte"

**URL:** <https://forum.ansible.com/t/utf8-codec-cant-decode-byte-0xff-in-position-0-invalid-start-byte/24293>\
**Category:** Ansible Project\
**Created:** [April 24, 2017, 8:24am UTC](https://forum.ansible.com/t/utf8-codec-cant-decode-byte-0xff-in-position-0-invalid-start-byte/24293 "2017-04-24T08:24:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![groupfiles14](https://avatars.discourse-cdn.com/v4/letter/g/54ee81/32.png) [@groupfiles14](https://forum.ansible.com/u/groupfiles14)\
**Post date:** [April 24, 2017, 8:24am UTC](https://forum.ansible.com/t/utf8-codec-cant-decode-byte-0xff-in-position-0-invalid-start-byte/24293/1 "2017-04-24T08:24:01Z")

</div>

Getting the subject mentioned error while reading a compressed json, any workaround for this?

`

- name: read local file  
set\_fact:  
reg\_changes: “{{ lookup(‘file’, ‘/home/tess/xl.json’) | from\_json }}”  
delegate\_to: localhost  
`

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [April 24, 2017, 11:36am UTC](https://forum.ansible.com/t/utf8-codec-cant-decode-byte-0xff-in-position-0-invalid-start-byte/24293/2 "2017-04-24T11:36:17Z")

</div>

Try using a site like [jsonlint.com](http://jsonlint.com) to check if your xl.json is actually valid JSON.

---

<div class="post-metadata">

**Author:** ![Toshio\_Kuratomi](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@Toshio\_Kuratomi](https://forum.ansible.com/u/Toshio_Kuratomi)\
**Post date:** [April 24, 2017, 3:44pm UTC](https://forum.ansible.com/t/utf8-codec-cant-decode-byte-0xff-in-position-0-invalid-start-byte/24293/3 "2017-04-24T15:44:04Z")

</div>

If it’s compressed, you probably need to uncompress it first. The from\_json filter doesn’t have builtin support for decompressing files. (I don’t believe any of our filters do)

-Toshio
