<?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: Field values returned in unicode in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405942#M31939</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You should always add a tag to your post in the new forums (i.e. Python) so that the python people can find your discussion and better yet start your discussion in the python space &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Jul 2014 13:34:14 GMT</pubDate>
    <dc:creator>RobertScheitlin__GISP</dc:creator>
    <dc:date>2014-07-16T13:34:14Z</dc:date>
    <item>
      <title>Field values returned in unicode</title>
      <link>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405941#M31938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the code below, the field values are returned in unicode (e.g. (u'&amp;nbsp; 06510',)). How do I get this to return ascii, as in 06510,? Thanks. Hopefully doing this right, new forums confusing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with arcpy.da.SearchCursor(fc, "OLDPLATE") as rows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if row is None or len(row) == 0: lstNullOldPlates.append("Null or empty")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else: lstAllOldPlates.append('{0}'.format(row))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:19:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405941#M31938</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2014-07-16T13:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: Field values returned in unicode</title>
      <link>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405942#M31939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Greg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; You should always add a tag to your post in the new forums (i.e. Python) so that the python people can find your discussion and better yet start your discussion in the python space &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;‌&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:34:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405942#M31939</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2014-07-16T13:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Field values returned in unicode</title>
      <link>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405943#M31940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you need to call the ord() method on it and it should convert your unicode string to ascii.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.python.org/2/library/functions.html" title="https://docs.python.org/2/library/functions.html"&gt;2. Built-in Functions — Python v2.7.8 documentation&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:45:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405943#M31940</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-16T13:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Field values returned in unicode</title>
      <link>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405944#M31941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin-top: auto; margin-bottom: auto;"&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman';"&gt;I've&lt;BR /&gt;moved your post into the &lt;/SPAN&gt; &lt;A _jive_internal="true" href="https://community.esri.com/community/developers/gis-developers/python"&gt;&lt;SPAN style="color: blue; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"&gt;Python&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="text-decoration: underline;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman';"&gt;space. You will get a much&lt;BR /&gt;better answer here as the &lt;/SPAN&gt;&lt;A _jive_internal="true" href="https://community.esri.com/community/help-and-feedback"&gt;&lt;SPAN style="color: blue; mso-fareast-font-family: 'Times New Roman';"&gt;GeoNet Help&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="mso-fareast-font-family: 'Times New Roman';"&gt; is intended for community&lt;BR /&gt;help and feedback. I have also added in a few additional tags. You can see more&lt;BR /&gt;on the community structure, and what topics are under each space from the&lt;BR /&gt;following documents:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: auto; margin-bottom: auto;"&gt; &lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-1544"&gt;&lt;SPAN style="color: blue; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"&gt;GeoNet Community Structure&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-top: auto; margin-bottom: auto;"&gt;&lt;A _jive_internal="true" href="https://community.esri.com/docs/DOC-1545"&gt;&lt;SPAN style="color: blue; font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"&gt;ArcGIS Discussion Forums Migration Strategy&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P style="margin-top: auto; margin-bottom: auto;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"&gt; Thanks!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-top: auto; margin-bottom: auto;"&gt;&lt;SPAN style="font-family: 'Times New Roman','serif'; font-size: 12pt; mso-fareast-font-family: 'Times New Roman';"&gt; Don &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:59:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405944#M31941</guid>
      <dc:creator>DonOpgenorth</dc:creator>
      <dc:date>2014-07-16T13:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Field values returned in unicode</title>
      <link>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405945#M31942</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks all. I searched for a python oriented forum, couldn't find it. This new format will really take some getting used to.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 15:33:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405945#M31942</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2014-07-16T15:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: Field values returned in unicode</title>
      <link>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405946#M31943</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Ian, but ord didn't work. The values are test, a mix of letters, blanks and numbers. Ord() works on one at a time, and gave me a TypeError when I tried parsing the values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did manage to fix the problem though. I'd forgotten that arcpy.da returns a tuple, not the (in this case) text value. When I added row[0] to the processing instead of just row, it worked as desired. Thanks everyone. I hesitate to mark my own answer as correct, don't want to violate protocol, but on the other hand that might be useful to others.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 19:42:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405946#M31943</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2014-07-16T19:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Field values returned in unicode</title>
      <link>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405947#M31944</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah, well I'm glad you got it worked out.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jul 2014 19:51:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405947#M31944</guid>
      <dc:creator>IanMurray</dc:creator>
      <dc:date>2014-07-16T19:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: Field values returned in unicode</title>
      <link>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405948#M31945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is your use case that requires you to convert unicode? Normal ascii characters should always be treated the same whether they are unicode or not.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Python treats unicode and text pretty much the same if the content doesn't contain any international characters. In Python 3.4 there is no distinction. The only way you can tell it is unicode is when it is rendered by repr(), for example when you enter the variable at the command line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jul 2014 18:00:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/field-values-returned-in-unicode/m-p/405948#M31945</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2014-07-17T18:00:24Z</dc:date>
    </item>
  </channel>
</rss>

