D15068: Bindings: Correct handling of sources containing utf-8

2018-09-14 Thread Stefan Brüns
This revision was automatically updated to reflect the committed changes. Closed by commit R240:28da9e614f66: Bindings: Correct handling of sources containing utf-8 (authored by bruns). CHANGED PRIOR TO COMMIT https://phabricator.kde.org/D15068?vs=40392=41646#toc REPOSITORY R240 Extra CMake

D15068: Bindings: Correct handling of sources containing utf-8

2018-09-14 Thread Stefan Brüns
bruns added a comment. In D15068#325752 , @bcooksley wrote: > The code itself looks fine to me - the change on line 752 is to allow handling of macOS / Windows line endings in addition to just Unix line endings I presume? Yes. Thats

D15068: Bindings: Correct handling of sources containing utf-8

2018-09-14 Thread Stefan Brüns
bruns added a comment. In D15068#325659 , @jtamate wrote: > Another solution (not tested here but used in other projects) could be to use > with open(source, "r", encoding="utf-8") as f: > (or if the file could contain the aberration BOM,

D15068: Bindings: Correct handling of sources containing utf-8

2018-09-14 Thread Luca Beltrame
lbeltrame accepted this revision. lbeltrame added a comment. This revision is now accepted and ready to land. LGTM. INLINE COMMENTS > sip_generator.py:752 > # > -return "".join(extract).replace("\n", " ") > +return b''.join(extract).decode('utf-8').replace("\r\n", "

D15068: Bindings: Correct handling of sources containing utf-8

2018-09-14 Thread Ben Cooksley
bcooksley added a comment. The code itself looks fine to me - the change on line 752 is to allow handling of macOS / Windows line endings in addition to just Unix line endings I presume? REPOSITORY R240 Extra CMake Modules REVISION DETAIL https://phabricator.kde.org/D15068 To: bruns,

D15068: Bindings: Correct handling of sources containing utf-8

2018-09-14 Thread Jaime Torres Amate
jtamate added a comment. Another solution (not tested here but used in other projects) could be to use with open(source, "r", encoding="utf-8") as f: (or if the file could contain the aberration BOM, you could use "utf-8-sig") And it should convert automatically all kind of line-ends