[PATCH] D45741: Python bindings: Fix handling of file bodies with multi-byte characters

2018-09-17 Thread Maximilian Heinzler via Phabricator via cfe-commits
mheinzler updated this revision to Diff 165728. mheinzler added a comment. Sorry, here's the diff for the whole files. The `b` function defined at the top of the file already does what you suggest. For python2 it returns the string unchanged, for python3 it calls `encode`. So there shouldn't be

[PATCH] D45741: Python bindings: Fix handling of file bodies with multi-byte characters

2019-02-03 Thread Maximilian Heinzler via Phabricator via cfe-commits
mheinzler abandoned this revision. mheinzler added a comment. Herald added a subscriber: arphaman. Herald added a reviewer: serge-sans-paille. Herald added a project: clang. I'm closing this because it has been fixed in master by: https://reviews.llvm.org/D56429 Repository: rC Clang CHANGES S

[PATCH] D45741: Python bindings: Fix handling of file bodies with multi-byte characters

2018-04-17 Thread Maximilian Heinzler via Phabricator via cfe-commits
mheinzler created this revision. mheinzler added a reviewer: clang. Herald added a subscriber: cfe-commits. With python3 there is a difference between the length of the string and the length of the utf-8 encoded bytes array. To not cut off characters at the end when the string contains multi-byt