Encoding error with SVGAndDataResult

Which tool versions are you using?

SDK: v13.6.0
Platform: v22.11.0
Python: v3.10.8
Isolation mode: venv

Current Behavior

A SVGAndDataResult is generating an Exception about character encoding.

Traceback (most recent call last):
  File "viktor_connector\connector.pyx", line 314, in connector.Job.execute
  File "viktor\core.pyx", line 1839, in viktor.core._handle_job
  File "viktor\core.pyx", line 1826, in viktor.core._handle_job._handle_view
  File "viktor\views.pyx", line 2021, in viktor.views.View._wrapper
  File "C:\DevOps\Python.ParametricDesign\RWZITank\app\tank\controller.py", line 117, in view_scia_analysis
    return SVGAndDataResult(image=scia_svg_data, data=scia_data)
  File "viktor\views.pyx", line 1441, in viktor.views.SVGAndDataResult.__init__
  File "viktor\core.pyx", line 869, in viktor.core.File.from_data
  File "viktor\core.pyx", line 849, in viktor.core.File.__init__
  File "viktor\core.pyx", line 700, in viktor.core._DataFileManager.__init__
  File "C:\Users\rkg\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 12, in encode
    return codecs.charmap_encode(input,errors,encoding_table)
UnicodeEncodeError: 'charmap' codec can't encode character '\u2212' in position 46431: character maps to <undefined>

Expected Behavior

When I downgrade the @SVGAndDataView into a @DataView or a @SVGView those views work fine. Seems to indicate both data parts in return SVGAndDataResult(image=scia_svg_data, data=scia_data) are valid. And the error is induced when both views are combined within Viktor.

Context (optional, but preferred)

Maybe something similar as the SVGResult issue that was solved in SDK v13.6.0 is still present in SVGAndDataResult?

1 Like

Hi @rkg ,

I think you are right, thanks for thinking along! We will look into it.

Hi @rkg

We have released a patch SDK v13.6.1 which should fix the issue.

Thanks! That solves it.

1 Like