review/rutil.py @ b443b42afe6f issue-90

Convert unicode to ascii for mercurial API.

Mercurial API can't work with python's Unicode objects.
Details http://mercurial.selenic.com/wiki/EncodingStrategy#Unicode_strings
author Alexander Stepanenko <olexander314@gmail.com>
date Mon, 15 Dec 2014 02:06:13 +0300
parents 96afc843f1a7
children (none)
from mercurial import encoding

def tolocal(s):
    return encoding.tolocal(s.encode('UTF-8'))

def fromlocal(s):
    return s.decode(encoding.encoding, 'replace')