accentuated characters (over Ascii 127 ) ?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
artsys
Posts: 4
Joined: Sat Mar 04, 2006 5:32 pm

accentuated characters (over Ascii 127 ) ?

Post by artsys »

Hi all, i'm a news here...

Howto use the Class Font with caracters over code ascii 127 (éàùèç..) ?
Is possible ?
I'm a French man lol

sample :

gui::IGUIFont* font = Device->getGUIEnvironment()->getFont("fonts/fontcourier.bmp");
core::stringw buf;
buf="Il était une fois un joli monde àéùçè";
....
font->draw(buf.c_str(), abc.",core::rect<s32>(130,10,300,50),video::SColor(255,255,255,255));

result on my screen
Il []tait une fois un joli monde [][][][][]

[] is the caracter in position 127 in the bmp file fontcourier.bmp

thank you in advance for your answers...[/b]
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

It works fine. Your problem is that you are not supplying a wide string to the stringw assignment operator. You need to do this... [pay special attention to the L in front of the quotes]

Code: Select all

core::stringw buf; 
buf=L"Il était une fois un joli monde àéùçè"; 
.... 
font->draw(buf.c_str(),core::rect<s32>(130,10,300,50),video::SColor(255,255,255,255)); 
artsys
Posts: 4
Joined: Sat Mar 04, 2006 5:32 pm

Post by artsys »

Thank,

but, i'm a Illegal byte sequence with gcc++ and the syntaxe :

L"abcde é"

and not with :
L"abcde "

...
Guest

Post by Guest »

Is gcc++ problem with unicode...arrrh...

MINGW32 version 3.7
W32API version 3.2

I seek how to correct this problem and i post the solution here.
artsys
Posts: 4
Joined: Sat Mar 04, 2006 5:32 pm

Post by artsys »

I solved the problem .

I add this option : -finput-charset=iso-8859-1 for gcc++.

It works fine.

If that can avoid with somebody of other seeking 2 hours like me.
Post Reply