phabricator: convert unicode to binary when writing patches
This is a quick fix to make `hg phabread D189` work.
It seems we might want to replace all `r''` to `u''`, and add more
`encoding.*to*` to be more explicit when interacting with `json` module.
Differential Revision: https://phab.mercurial-scm.org/D192
--- a/contrib/phabricator.py Thu Jul 27 23:15:14 2017 +0900
+++ b/contrib/phabricator.py Thu Jul 27 12:03:01 2017 -0700
@@ -560,7 +560,8 @@
if k in meta:
header += '# %s %s\n' % (_metanamemap[k], meta[k])
- write(('%s%s\n%s') % (header, desc, body))
+ content = '%s%s\n%s' % (header, desc, body)
+ write(encoding.unitolocal(content))
@command('phabread',
[('', 'stack', False, _('read dependencies'))],