846 views
in GUI Development by
Hi,

I am getting a strange output from

emwiString = EwNewStringAnsi( "Crème" );

Instead of getting 'Crème' I am getting 'Crème (0xC3 and 0xA8 in place of 0xE8). I have not tried any other accented characters.

I have checked the Font range is set to 0x20 - 0xFF, this happens with Arial and Noto Medium.

It is OK if I use the string internally, it is only when I retrieve it from outside it is an issue.

Any ideas?

Thanks

Phil

1 Answer

0 votes
by

Hello Phil,

the unexpected conversion occurs somewhere outside of Embedded Wizard. The function EwNewStringAnsi() just copies the character codes 1:1. It will never convert 0xE8 to 0xC3+0xA8. Possibly, the conversion is made by the editor you use to edit the C file? Review the encoding settings for the editor in such case.

Please note, EwNewStringAnsi() has a limited functionality. Concrete it is intended to process Ansi strings containing characters in range 0x00..0xFF whereby the function has no information about the exact (language dependent) encoding of the string. This may lead to problems with character codes > 0x7F.

It is OK if I use the string internally, it is only when I retrieve it from outside it is an issue.

This indicates an encoding problem with the original string. Maybe the string is UTF8 encoded. Then try the function EwNewStringUtf8().

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...