D3980: contrib/phabricator: Convert description into local

Yuya Nishihara yuya at tcha.org
Thu Jul 26 08:05:22 EDT 2018


> That could replace `json.loads` at line 211. I guess it could be done by using a function that recursively convert strings.

Could be.

```
def _maybeunitolocal(u):
    if isinstance(u, pycompat.unicode):
        return encoding.unitolocal(u)
    return u
pycompat.rapply(_maybeunitolocal, json.loads(...))
```


More information about the Mercurial-devel mailing list