# UnicodeEncodeError when using when\_string

**URL:** <https://forum.ansible.com/t/unicodeencodeerror-when-using-when-string/12941>\
**Category:** Ansible Project\
**Created:** [June 11, 2013, 7:36am UTC](https://forum.ansible.com/t/unicodeencodeerror-when-using-when-string/12941 "2013-06-11T07:36:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Herve\_Leclerc](https://avatars.discourse-cdn.com/v4/letter/h/a8b319/32.png) [@Herve\_Leclerc](https://forum.ansible.com/u/Herve_Leclerc)\
**Post date:** [June 11, 2013, 7:36am UTC](https://forum.ansible.com/t/unicodeencodeerror-when-using-when-string/12941/1 "2013-06-11T07:36:49Z")

</div>

Thank to [mpdehaan](https://github.com/mpdehaan) reply :

using the new syntax available (and preferred) in 1.2

when: “‘AWESOME’ not in result.content”

This works like a charm
