<p>The <code>curses.ascii</code> module has some nice functions defined, that allow for example to recognize which characters are printable (<code>curses.ascii.isprint(ch)</code>).</p>

<p>But, diffrent character codes can be printable depending on which locale setting is being used. For example, there are certain polish characters:</p>

<pre><code>&gt;&gt;&gt; ord('a')
97
&gt;&gt;&gt; ord('ą')
177
&gt;&gt;&gt; 
</code></pre>

<p>I'm wondering, is there a better way to tell if a number represents printable character then the one used in <code>curses.ascii</code> module:</p>

<pre><code>def isprint(c): return _ctoi(c) &gt;= 32 and _ctoi(c) &lt;= 126
</code></pre>

<p>which is kind of locale-unfriendly.</p>

If you convert the character to a unicode then you can use unicodedata:
```
```
>>> unicodedata.category(u'ą')[0] in 'LNPS'
True
```
```