Page 1 of 1

button text with accents, bug or am I missing sth ?

Posted: Mon Oct 09, 2006 16:16
by Pompei2
I don't know if this is a bug or if i am doing something wrong, but when I am setting the text of a button and the text's last or last-1 charachter is an accent like é, è, à, ..., the text of the button won't stop at the closing " but continues. I know i'm not clear, so here you have some screenshots to describe the problem.

Notice that the texts on the left upper side, everything is correct, this is because there are at least 2 chars behind the accent.

Image

Code: Select all

<Window Type="TaharezLook/Button" Name="os/Advanced">
   <Property Name="UnifiedPosition" Value="{{1,-105},{1,-305}}" />
   <Property Name="UnifiedSize" Value="{{0,100},{0,300}}" />
   <Property Name="Text" Value="Avancé" />
</Window>


Image

Code: Select all

<Window Type="TaharezLook/Button" Name="os/Advanced">
   <Property Name="UnifiedPosition" Value="{{1,-105},{1,-305}}" />
   <Property Name="UnifiedSize" Value="{{0,100},{0,300}}" />
   <Property Name="Text" Value="Avancée" />
</Window>


Image

Code: Select all

<Window Type="TaharezLook/Button" Name="os/Advanced">
   <Property Name="UnifiedPosition" Value="{{1,-105},{1,-305}}" />
   <Property Name="UnifiedSize" Value="{{0,100},{0,300}}" />
   <Property Name="Text" Value="Avancées" />
</Window>


and my layout file is encoded as ANSI. I tried it as an UTF-8 file, but in this case, the accets were two strange signs.
Is this a bug or what am I missing ?

Posted: Mon Oct 09, 2006 17:37
by lindquist
seems like a strange issue.
The CEGUI XML files are all assumed to be utf8 encoded. any other encoding will surely yeild unexpected results.

Posted: Mon Oct 09, 2006 20:02
by Pompei2
OK, I encoded my file as UTF-8, write the accents é, start my game and now "Avancé" becomes "Avancé" :? my editor is Notepad++, do you have some suggestions ? IIRC, UTF-16 exists too (but not supported by notepad++), is it possible that this is what CEGUI expects ?

Posted: Tue Oct 10, 2006 10:03
by lindquist
cegui only supports loading utf8 encoded files. internally everything is converted to utf32 so all glyphs can be encoded as single values.

it could be a problem with the XML parser module you're using. Which one do you use? and do the others act up as well?

Posted: Tue Oct 10, 2006 12:12
by Pompei2
Yay thank you ! I was using TinyXML. Now i changed my project to use XercesXML and it works (it is reading the accents correctly).

Posted: Sun Oct 15, 2006 05:38
by Gaal
Salut Pompei2,

I had some quite a similar problem with TinyXML and now I'm using Expat.
Everything is going well except for a button containing "<<" which expat makes an error saying that the tag "<<" does not exist !!!

You can also have a look at the topic http://www.cegui.org.uk/phpBB2/viewtopic.php?t=1860

Bonjour de Toulouse

Posted: Sun Oct 15, 2006 13:29
by lindquist
You should use &lt; or &gt; in XML and not the <> chars directly

Posted: Sun Oct 15, 2006 19:30
by Gaal
You are right Linquist.
Thanks


PS: Linquist, Do you know Rovsing ?

Posted: Sun Oct 15, 2006 20:01
by Pompei2
lindquist wrote:You should use &lt; or &gt; in XML and not the <> chars directly

I thought then maybe to be sure to correctly display an accent, i could write

Code: Select all

&eacute;
in the layout file, tried this out but got the following error:

FTS: Error: CEGUI erreur lors du chargement de la fenêtre menu_main.Francais.layout': 'XercesParser::parseXMLFile - An error occurred at line nr. 62 while parsing XML file 'menu_main.Francais.layout'. Additional information: Entity 'eacute' was not found' !

just to tell you that it doesn't work.

Bonjour de Liège :)

Posted: Mon Oct 16, 2006 17:30
by lindquist
XML only defines a small number of entities:
http://www.w3.org/TR/REC-xml/#sec-predefined-ent

Any others must be predeclared it seems though I must admit that I'm not much into this.

P.S.
Linquist, Do you know Rovsing ?

Cant say I do!

Posted: Tue Oct 17, 2006 06:20
by Gaal
Quote:
Linquist, Do you know Rovsing ?

Cant say I do!


I was just asking because Rovsing is a software company which we are working with for the ESA ATV program. It is based in Skovlunde, not far from Copenhagen. I have been twice over there in 2003 and 2004. So I was wandering if you knew it, but may be you are not working in computer business!

PS:I apologize for flooding the topic! :oops: but when I see some body from a place I know, it remind me some good souvenirs.
Please delete the post after reading.

Posted: Tue Oct 17, 2006 07:47
by lindquist
Cant see a problem with going a little offtopic now and then.
I've never heard of Rovsing, and I dont work in the software business.

I've been to Skovlunde many times though. Denmark is a small country :)