Encoding Issue using Knimepy and Containers

I’m really liking the KNIME py package for running workflows in batch mode locally. It works great but I’ve hit an issue with character encodings when data is returned from KNIME to a python dataframe.

When my data contains æ,å,ø and so on it is not encoding correctly on the transfer from KNIME.

In KNIME the data looks normal:

image

But the dataframe in KNME looks like this:

image

Loaded using code like this:

with knime.Workflow(WORKFLOW) as wf:
    wf.execute()
    order = wf.data_table_outputs[0]
    customer = wf.data_table_outputs[1]

@potts - any ideas what’s causing this? How do I see what encoding is being used between KNIME and python?

Hi @bobpeers,
Can you try to set the following environment variable for your Python process: set PYTHONUTF8=1?
I got this from here. That issue is related to reading files, but maybe the same applies to your problem.
Kind regards,
Alexander

2 Likes

HI @AlexanderFillbrunn ,

Many thanks for the link, it works perfectly!

Best regards
Bob

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.