- Online Community Forums » Programming Questions » UTF-8 Russian text output

This thread is locked; no one can reply to it. rss feed Print
UTF-8 Russian text output
Member #14,714
November 2012

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, "веков");

Member #7,859
October 2006

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

Member #14,714
November 2012

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

Member #2,727
September 2002

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

Peter Wang
Member #23
April 2000

And al_ustr_new allocates memory.

Go to: