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

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

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

Postby Pompei2 » Mon Oct 09, 2006 16:16

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 ?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Mon Oct 09, 2006 17:37

seems like a strange issue.
The CEGUI XML files are all assumed to be utf8 encoded. any other encoding will surely yeild unexpected results.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Mon Oct 09, 2006 20:02

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 ?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Tue Oct 10, 2006 10:03

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?

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Tue Oct 10, 2006 12:12

Yay thank you ! I was using TinyXML. Now i changed my project to use XercesXML and it works (it is reading the accents correctly).

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Postby Gaal » Sun Oct 15, 2006 05:38

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

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Sun Oct 15, 2006 13:29

You should use &lt; or &gt; in XML and not the <> chars directly

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Postby Gaal » Sun Oct 15, 2006 19:30

You are right Linquist.
Thanks


PS: Linquist, Do you know Rovsing ?

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Sun Oct 15, 2006 20:01

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 :)

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Mon Oct 16, 2006 17:30

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!

User avatar
Gaal
Not too shy to talk
Not too shy to talk
Posts: 28
Joined: Thu Jul 21, 2005 03:36
Location: Ô Toulouse

Postby Gaal » Tue Oct 17, 2006 06:20

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.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Postby lindquist » Tue Oct 17, 2006 07:47

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 :)


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 1 guest