I use Mathematica and Pythonika to run Python code inside it. And I'm not quite sure what causes my issue: all unicode Python objects look like this: А\.00л\.00е\.00к\.00с (instead of Александр), i.e. there is an extra symbol after each letter, and thus the string is truncated (its length remains same). At the Pythonika page the author mentioned that unicode is supported, although not well-tested. Anyone experienced this? What are the possible workarounds?

  • 2
    $\begingroup$ It sounds like this is a Pythonika problem/bug in the C layer connecting Mathematica and Python. Have you contacted the author of Pythonika? I'd say the question is on the border of being off-topic ... Unfortunately Pythonika is a bit sloppily implemented. It is a useful package, but it's a quick and dirty implementation. It would take considerably more work to implement a proper link. $\endgroup$
    – Szabolcs
    May 23, 2013 at 14:02
  • $\begingroup$ Anyway, can you please give a full but minimal example that reproduces the problem? Post the precise code that you used, but reduce it to the essentials (a few lines). I'll take a look then. $\endgroup$
    – Szabolcs
    May 23, 2013 at 14:05
  • $\begingroup$ @Szabolcs: oh, that was really a probably bug in Pythonika, didn't think about it being possible. I've fixed it (both for unicode and non-ascii strs), probably in a hacky way as I'm not quite good at C. Fix is available at hg.aplavin.ru/pythonika $\endgroup$
    – aplavin
    May 23, 2013 at 14:39
  • $\begingroup$ Excellent, thanks! (and +1 for the answer) $\endgroup$
    – Szabolcs
    May 23, 2013 at 14:56
  • $\begingroup$ I wrote to the author once in the past but got no reply. If it will be the same this time, we should collect these fixes somewhere. I was also just playing with it and was planning to put it here (haven't pushed the changes yet). $\endgroup$
    – Szabolcs
    May 23, 2013 at 14:59

1 Answer 1


This issue was caused by a bug in Pythonika. Fix is now available at http://hg.aplavin.ru/pythonika/, will send it to the author.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.