can't display foreign characters anymore + crash [solved]

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

can't display foreign characters anymore + crash [solved]

Post by suny »

Ogre Version: 1.31.1
Operating System: :?: windows
Render System: :?: dx9c

Hi,
Since a few weeks, I can't display any non-standard characters anymore with my game (like éèà).

If I do:

Code: Select all

Ogre::OverlayManager::getSingleton().getOverlayElement("pauseMessage")->setCaption("AçèààA");
It displays only "A".

Furthermore, I crash in release with some overlays:

Code: Select all

Ogre::ItemIdentityException::ItemIdentityException: Code point 84415360 not found in font arialBlk_outlines in Ogre::Font::getGlyphInfo at C:\OgreSDK\Ogre3D\ogre\Components\Overlay\include\OgreFont.h
In debug, my app freeze. If I break, I'm stuck in:

Code: Select all

utf8_decode(const char *s, uint32_t *c, int *e).
s is equal to: s = 0x00000000001bd3e4 "ÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌḬ̀ȧ\x1e"

My fonts and my fontdef contain those characters, and it was working a few weeks ago. I'm not sure of what or when it broke (when I went from 32 bits to 64 bits?) and I really don't know what to do....

S.
Last edited by suny on Tue Nov 23, 2021 9:08 am, edited 1 time in total.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: can't display foreign characters anymore + crash

Post by paroj »

that code did not change since 13.0.0, so its likely on your side.

make sure that your source files are actually utf8 encoded and compare the input and outputs to utf8_decode to what you would expect as per:
https://en.wikipedia.org/wiki/UTF-8#Examples
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: can't display foreign characters anymore + crash

Post by suny »

I tried to bisect with my old versions, and in fact, I was displaying foreign characters and not crashing with 1.12.13.
It stopped working with 13.0.0, but I didn't notice it until now...

Furthermore, even if I can't display an "è" anymore, how could I avoid Ogre crashing?
S.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: can't display foreign characters anymore + crash

Post by paroj »

I can confirm the issue. No workaround at the moment.

edit: if you want to look into it yourself, you can try reproducing it only using utf8_decode which lives here:
https://github.com/skeeto/branchless-utf8
User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: can't display foreign characters anymore + crash

Post by suny »

Thanks, Paroj.
To be honest, as a tech artist I'm completely out of my league with utf, unicode and such :(

In the meantime, I will try to strip offending characters from my strings to avoid my beta testers crashing.
S.
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: can't display foreign characters anymore + crash

Post by paroj »

User avatar
suny
Greenskin
Posts: 137
Joined: Thu Mar 12, 2020 5:53 pm
x 60

Re: can't display foreign characters anymore + crash

Post by suny »

It works :)
Thanks a lot, Paroj!
S.
Post Reply