Coder Social home page Coder Social logo

Comments (1)

t-wolfeadam avatar t-wolfeadam commented on June 16, 2024

Hi!

Looks like my lack of knowledge about handling various string encodings caught up to me!

After looking into this, the problem is with my Python code that handles incoming binary data from Java (i.e., AL models). I have it set to only convert using utf-8 (reference) - what I assumed would be ok for everything - causing it to fail when any latin characters are passed.

For a fix, I've added extra handling to use ISO-8859-1 as a fallback.

And to validate this, I looped thru all characters in utf-8, utf-16, and iso-8859-1 (thanks to this SO post) and checked whether Pypeline would throw an error when running: pyCommunicator.run(String.format("x='%s'", chr)); In each, only 5 failed, but they were due to unhandled syntax reasons (e.g., newline characters, single quote, backslash).

I've pushed the changes but will include this as part of the next release. For convenience, you can download an updated jar file: Pypeline.zip. I'm closing but feel free to let me know if you still have issues with it!

from anylogic-pypeline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.