36 views
in System Integration by
The strings used in our embedded wizard application are defined in an offline data base. Via python scripting an utf-8 encoded .ewu file is created containing the strings. Problem are the german Umlaute öäü... I see EmbeddedWizard normally saves its files as UTF-8, but defining a german Umlaut ÄÖÜ... e.g. as value of a string, encoding is changed to Western(Windows 1252)
Is there a possibility to read utf-8 encoded ewu files containing german Umlaute or must we write Western(Windows 1252)  files?

1 Answer

0 votes
by

Hello Juergen,

because of its old past Embedded Wizard uses a trick to store project files. Concrete, all characters lying below 0x0100 (256 dec) are encoded as they are. Character codes >= 0x0100 are encoded in the \UXXXX notation (e.g. \U12AB). In this way it was possible to encode Unicode characters from the range 0x0000 .. 0xFFFF and edit the project files in text editors not supporting UTF-8.

Last year in version 9.30 we have enhanced the read functionality to also accept the UTF-8 format directly. If you are using Embedded Wizard 9.30 and you create the EWU file encoded in UTF-8, Embedded Wizard should be able to read the file. Important: the UTF-8 file has to start with a valid BOM otherwise Embedded Wizard will fall back in the compatibility mode and interprete the file as if it were created in the old format.

If you are using an older version of Embedded Wizard (version <= 9.20), you have to encode the files in the format as explained above. The best approach: character codes < 128 are stored as they are. Characters >= 128 should be stored in the \UXXXX notation.

Please note, even if Embedded Wizard 9.30 is able to read UTF-8 files, it stores the projects still in its old proprietary format as explained above. This was essential to guarantee the compatibility with older versions. With the next version 9.40 we will switch off the old proprietary format and store all text files consequently in UTF-8.

Does it help you further?

Best reghards

Paul Banach

by
Thanks, adding the BOM does the trick. In python simply use encoding='utf-8-sig' opening the file instead of 'utf-8'. Using EmWi 9.30.
by

> If you are using Embedded Wizard 9.30 you ccan reate the EWU file encoded in UTF-8, Embedded Wizard should be able to read the file.

This is great! Is this documented in the release notes of this version? IMHO, you should add this to this document.

Does this apply to the fontrange.txt as well? Can you insert UTF-8 encoded glyphs in this file or do you still have to use the \UXXXX notation?

by

Hello,

The UTF-8 file format is also supported for text files referred in the Ranges attribute. This expects Embedded Wizard version >= 9.30. If you create the ranges text files, don't forget to place the BOM at the begin of the file. With the next version we will adapt the documentation to officially include the UTF-8 support.

Does it help you?

Best regrads

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...