MopeSWTP-SS21 / MopeSWTP

MIT License
1 stars 0 forks source link

Unescape Modelica strings before presenting them to the user #92

Open CSchoel opened 3 years ago

CSchoel commented 3 years ago

Some (if not all?) OpenModelica Scripting API commands that return Strings, return them in the same format as they would need to be written in a Modelica program, i.e. with escape signs for newlines, quotes, and the like. You should therefore...

  1. Check whether omc-java-api already performs some unescaping, and if this is the case check whether it is correct. As a reference, you can use the unescape function in MoST.jl. It is tested for quite a few cases and the collection of escaped signs is taking directly from the Modelica Specification.
  2. Keep an eye out for escape signs in your output and verify if they should be there or not.
  3. If you notice any issues, implement your own unescape function that fixes them or (if it exists) fix the unescape in omc-java-api.