In python (2.7.1):
>>> x = u'$€%'
>>> x.find('%')
2
>>> len(x)
3
Whereas in ipython:
>>> x = u'$€%'
>>> x.find('%')
4
>>> len(x)
5
What's going on here?
edit: including the additional info requested from the comments below
ipython
>>> import sys, locale
>>> reload(sys)
<module 'sys' (built-in)>
>>> sys.setdefaultencoding(locale.getdefaultlocale()[1])
>>> sys.getdefaultencoding()
'UTF8'
>>> x = u'$€%'
>>> x
u'$\xe2\x82\xac%'
>>> print x
$â¬%
>>> len(x)
5
python
>>> import sys, locale
>>> reload(sys)
<module 'sys' (built-in)>
>>> sys.setdefaultencoding(locale.getdefaultlocale()[1])
>>> sys.getdefaultencoding()
'UTF8'
>>> x = u'$€%'
>>> x
u'$\u20ac%'
>>> print x
$€%
>>> len(x)
3