UTF-8 Russian text output

Is this the correct approach in order to output text in Russian?
How do I convert the char string into ALLEGRO_USTR*
Any help appreciated?

al_draw_ustr(myFont, color, xPos, yPos, NULL, "веков");


Although I haven't used it yet, I believe you either use al_ustr_new or al_ref_cstr. Maybe Allegro handles UTF-8 internally, even if you don't use the USTR functions.
In any case also make sure your source file's encoding is UTF-8


Perfect! Thanks.

al_draw_ustr(myFont, color, xPos, yPos, NULL, al_ustr_new("веков"));

Saved source file (MSVC2010) using encoding: Unicode (UTF-8 without signature) - Codepage 65001


Should work with simply al_draw_text too, Allegro 5 always treats strings as being UTF-8.

Peter Wang

And al_ustr_new allocates memory.

Thread #611708. Printed from Allegro.cc