KxSystems / embedPy

Allows the kdb+ interpreter to call Python functions
https://code.kx.com/q/interfaces
Apache License 2.0
87 stars 42 forks source link

Error running expressions containing strings with invalid UTF-8 #32

Closed clovetea closed 6 years ago

clovetea commented 6 years ago

This works in python

>>> eval("len(\"\277\")")
1

but from q I get this

q).p.eval("len(\"\277\")")
  File "<string>", line 1
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xbf in position 0: invalid start byte
'p.c:71 runs pyerr
  [1]  /home/tepu/embedPy-master/p.q:21: .p.wfunc:{[f;x]r:wrap f x 0;$[count x:1_x;.[;x];]r}
clovetea commented 6 years ago

Looks like I should have been running .p.eval("len(\"\277\")")