Re: [vim/vim] Impossible to pass non-UTF-8 strings from vim to Python 3 (#1053)

2020-12-22 Fir de Conversatie puremo...@gmail.com
Bit off the wall, but perhaps we should provide a py3 api something like `vim.eval_bytes()` returning a `bytes` instance rather than trying to decode the evaluated bytes into a (unicode) `str` object. In the general case a vim string variable can contain any bytes (except NUL?); to read that in

Re: [vim/vim] Impossible to pass non-UTF-8 strings from vim to Python 3 (#1053)

2016-09-12 Fir de Conversatie Christian Brabandt
Am 2016-09-12 11:09, schrieb Björn Linse: On Monday, September 12, 2016 at 10:57:39 AM UTC+2, Christian Brabandt wrote: On So, 11 Sep 2016, Björn Linse wrote: > On Sunday, September 11, 2016 at 6:14:14 PM UTC+2, Björn Linse wrote: > > 615351832d75df3dfbc3f22694e675583e0b325d > BTW, something is

Re: [vim/vim] Impossible to pass non-UTF-8 strings from vim to Python 3 (#1053)

2016-09-12 Fir de Conversatie Björn Linse
On Monday, September 12, 2016 at 10:57:39 AM UTC+2, Christian Brabandt wrote: > Hi Björn! > > On So, 11 Sep 2016, Björn Linse wrote: > > > On Sunday, September 11, 2016 at 6:14:14 PM UTC+2, Björn Linse wrote: > > > 615351832d75df3dfbc3f22694e675583e0b325d > > BTW, something is wrong with the gith

Re: [vim/vim] Impossible to pass non-UTF-8 strings from vim to Python 3 (#1053)

2016-09-12 Fir de Conversatie Christian Brabandt
Hi Björn! On So, 11 Sep 2016, Björn Linse wrote: > On Sunday, September 11, 2016 at 6:14:14 PM UTC+2, Björn Linse wrote: > > 615351832d75df3dfbc3f22694e675583e0b325d > BTW, something is wrong with the github <-> vim-dev bridge, this > comment (and the edited version with the correct link below) i

Re: [vim/vim] Impossible to pass non-UTF-8 strings from vim to Python 3 (#1053)

2016-09-11 Fir de Conversatie Nikolay Aleksandrovich Pavlov
2016-09-11 19:23 GMT+03:00 Björn Linse : > What is wrong with just using CODEC_ERROR_HANDLER directly? AFAIR this is because Python-2 may need "surrogateescape" argument in the Python->Vim direction (to make writing cross-Python scripts), but it definitely does not need it when converting from Vim

Re: [vim/vim] Impossible to pass non-UTF-8 strings from vim to Python 3 (#1053)

2016-09-11 Fir de Conversatie Christian Brabandt
Hi Björn! On So, 11 Sep 2016, Björn Linse wrote: > On Sunday, September 11, 2016 at 6:14:14 PM UTC+2, Björn Linse wrote: > > 615351832d75df3dfbc3f22694e675583e0b325d > BTW, something is wrong with the github <-> vim-dev bridge, this comment (and > the edited version with the correct link below)

Re: [vim/vim] Impossible to pass non-UTF-8 strings from vim to Python 3 (#1053)

2016-09-11 Fir de Conversatie Björn Linse
On Sunday, September 11, 2016 at 6:14:14 PM UTC+2, Björn Linse wrote: > 615351832d75df3dfbc3f22694e675583e0b325d > > > — > You are receiving this because you commented. > Reply to this email directly, view it on GitHub BTW, something is wrong with the github <-> vim-dev bridge, this comment (and

Re: [vim/vim] Impossible to pass non-UTF-8 strings from vim to Python 3 (#1053)

2016-09-11 Fir de Conversatie Nikolay Aleksandrovich Pavlov
I would suggest something like below, but I have no tests. commit 615351832d75df3dfbc3f22694e675583e0b325d Author: ZyX Date: Tue Aug 16 21:42:24 2016 +0300 Use surrogateescape when appropriate diff --git a/src/if_py_both.h b/src/if_py_both.h index 35ad5d0..6709300 100644 --- a/src/if_py_b