How to convert unicode numbers to ints?
<blockquote>
  <p>Arabic and Chinese have their own glyphs for digits.  <code>int</code> works correctly with all the different ways to write numbers.</p>
</blockquote>

<p>I was not able to reproduce the behaviour (python 3.5.0)</p>

<pre><code>&gt;&gt;&gt; from unicodedata import name
&gt;&gt;&gt; name('í í¹¤')
'RUMI DIGIT FIVE'
&gt;&gt;&gt; int('í í¹¤')
ValueError: invalid literal for int() with base 10: 'í í¹¤'
&gt;&gt;&gt; int('äº')  # chinese/japanese number five
ValueError: invalid literal for int() with base 10: 'äº'
</code></pre>

<p>Am I doing something wrong?  Or is the claim simply incorrect (<a href="http://www.jjinux.com/2012/03/pycon-advanced-python-tutorials.html" rel="nofollow">source</a>).  </p>

<p>The source is incorrect.</p>

<p>From python doc:</p>

<blockquote>
  <p>class int(x, base=10)</p>
  
  <p>Return an integer object constructed from a
  number or string x, or return 0 if no arguments are given. If x is a
  number, return x.__int__(). For floating point numbers, this truncates
  towards zero.</p>
  
  <p>If x is not a number or if base is given, then x must be a string,
  bytes, or bytearray instance <strong>representing an integer literal in radix
  base</strong>. </p>
</blockquote>

<p>And an integer literal is just a string of numbers.</p>

<p>Edit: Was wrong, dug into the source code and found <a href="http://svn.python.org/projects/python/trunk/Python/mystrtoul.c" rel="nofollow">this</a> function is called when python wants to convert a string to int. There is a <strong>py_CHARMASK</strong> which <em>I guess</em> contains the information we need, but I could not find it :/</p>

python python-3.x unicode