How to handle unicode characters in python scripts

I have been trying to make pyhon script in ignition which generates strings with scandic leters (ä ö), but the problem is that printing and handling that text is almost impossible to get rigth encoding and format.

Is there a certain way to handle unicode characters in ignition?

Are you prefixing your string literals with u, as in; u"my stringä ö"?

Your post is tagged 8.0 & perspective - are you trying to display these characters in Perspective components? Or can you go into more detail about precisely where you’re trying to render these characters and what’s not working?

Hi all,

can i store the ö german character in SQL Database using named query

Did you try ?

edit: And it's not a specifically German character, we use it in France as well.

I tried but it is giving me character as

original char = Roboter 1_Wendelföxyz 1 Prüfspannungsschluß bei der Bolzen Entnahme

printed char = Roboter 1_Wendelf\xf6xyz 1 Pr\xfcfspannungsschlu\xdf bei der Bolzen Entnahme

Share the code you used? What kind of column is the table in your database?

The named query is
INSERT INTO [CG_Process_data_pool].[dbo].[FA_WendelfordererLog] (mainWeldMc,boltNr,cabType,machineName,AlarmText)
VALUES (:mainWeldMc,:boltNr,:cabType,:machineName,:AlarmText)

Here AlarmText param value we are passing from script and text is
Roboter 1_Wendelföxyz 1 Prüfspannungsschluß bei der Bolzen Entnahme

so, the same text we have to pass in db.

The Column datatype is nvarchar(255)