cancel
Showing results for 
Search instead for 
Did you mean: 

How to print characters in cp866 encoding?

Alex Golubev
Associate II

Hi.

I need to print characters in cp866 format. For printing, I use the printf function with an override of the write function. How can I make character printing using printf in cp866 encoding?

Thank you.

4 REPLIES 4
Alex Golubev
Associate II

I am using stm32cubeid

TDK
Guru

This may work:

https://decoding.wordpress.com/2010/03/18/eclipse-how-to-change-the-console-output-encoding/

If you feel a post has answered your question, please click "Accept as Solution".
Alex Golubev
Associate II

I didn't find cp866 in encoding settings.

0693W000006GtaPQAS.pngWhat am I doing wrong?

Pavel A.
Evangelist III

For CP-866 use this encoding table: https://www.ascii-codes.com/cp866.html

Of course if you print that to a serial terminal or similar device it should be able to display it properly.

If the source text is in unicode (utf-8, utf-16...), convert it according to the table.

-- pa