<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 6: ordinal not in range(128) in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/unicodedecodeerror-ascii-codec-can-t-decode-byte/m-p/555693#M43403</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;raw = u'Soporté'&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; print raw&lt;/P&gt;&lt;P&gt;Soporté&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Dec 2014 16:22:20 GMT</pubDate>
    <dc:creator>BruceHarold</dc:creator>
    <dc:date>2014-12-02T16:22:20Z</dc:date>
    <item>
      <title>UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 6: ordinal not in range(128)</title>
      <link>https://community.esri.com/t5/python-questions/unicodedecodeerror-ascii-codec-can-t-decode-byte/m-p/555692#M43402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="text-align: left;"&gt;I am trying to convert unicode to string, but I am getting UnicodeDecodeError. The original issue is related to working with a json return and creating a string, but here is a simplified example:&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;raw = unicode("Soporté")
print string&lt;/PRE&gt;&lt;P style="text-align: left;"&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 6: ordinal not in range(128)&lt;/P&gt;&lt;P style="text-align: left;"&gt;&lt;/P&gt;&lt;P style="text-align: left;"&gt;I have tried the suggestion from here: &lt;A href="https://community.esri.com/message/429880" target="_blank"&gt;Rename layer with unsupported signs in a mxd via python?&lt;/A&gt;‌&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;raw = unicode("Soporté")
string = raw.decode('utf-8')
print string
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And here: &lt;A href="https://community.esri.com/message/94636" target="_blank"&gt;Write Russian field names to txt&lt;/A&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;raw = unicode("Soporté")
string = raw.encode('utf-8')
print string&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I get the same error: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 6: ordinal not in range(128)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:00:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unicodedecodeerror-ascii-codec-can-t-decode-byte/m-p/555692#M43402</guid>
      <dc:creator>TimothyHales</dc:creator>
      <dc:date>2021-12-12T00:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 6: ordinal not in range(128)</title>
      <link>https://community.esri.com/t5/python-questions/unicodedecodeerror-ascii-codec-can-t-decode-byte/m-p/555693#M43403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;raw = u'Soporté'&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; print raw&lt;/P&gt;&lt;P&gt;Soporté&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Dec 2014 16:22:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unicodedecodeerror-ascii-codec-can-t-decode-byte/m-p/555693#M43403</guid>
      <dc:creator>BruceHarold</dc:creator>
      <dc:date>2014-12-02T16:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 6: ordinal not in range(128)</title>
      <link>https://community.esri.com/t5/python-questions/unicodedecodeerror-ascii-codec-can-t-decode-byte/m-p/555694#M43404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks &lt;A href="https://community.esri.com/migrated-users/3241" target="_blank"&gt;Bruce Harold&lt;/A&gt;‌! That works for printing the text, but I've added some complexity beyond printing. I am trying to concatenate the unicode with a string and append it to a list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;list = []
raw = u'Soporté'

list.append("Department: {}".format(raw))
print list
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:00:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unicodedecodeerror-ascii-codec-can-t-decode-byte/m-p/555694#M43404</guid>
      <dc:creator>TimothyHales</dc:creator>
      <dc:date>2021-12-12T00:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 6: ordinal not in range(128)</title>
      <link>https://community.esri.com/t5/python-questions/unicodedecodeerror-ascii-codec-can-t-decode-byte/m-p/555695#M43405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add the 'u' in front of my concatenated string as &lt;A href="https://community.esri.com/migrated-users/3241" target="_blank"&gt;Bruce Harold&lt;/A&gt;‌ suggested worked. Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;list = []&amp;nbsp; 
raw = u'Soporté'&amp;nbsp; 
&amp;nbsp; 
list.append(u"Department: {}".format(raw))&amp;nbsp; 
print list &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:00:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/unicodedecodeerror-ascii-codec-can-t-decode-byte/m-p/555695#M43405</guid>
      <dc:creator>TimothyHales</dc:creator>
      <dc:date>2021-12-12T00:00:38Z</dc:date>
    </item>
  </channel>
</rss>

