Author Topic: How to manage OEM 866 encoding  (Read 5937 times)

Offline Xavier65

  • Single posting newcomer
  • *
  • Posts: 4
How to manage OEM 866 encoding
« on: September 01, 2018, 11:17:59 am »
Hello!

I bought Stephen Prata's sixth edition of "C Primer Plus", and I love this book.  In all programs all the input/output data is translated into Russian.  Russian looks fine in the editor built into CodeBlocks.  However, when I run a console app, I see abracadabra instead of nice Cyrillic symbols.  It is said that Windows 866 encoding is needed, but it's not present in the editor drop-down list in settings.  If I somehow manage to add Windows 866 to the editor (add it to the config file as suggested in some "clever" Bjarne Stroustrup book), the console app shows Cyrillic OK, but I type abracadabra in the editor.
I read a lot of suggestions for this problem, but they all seem awkward and not easy to use.  In the attached screenshots you can see what my fellow guru  8) programmer did.  It works, but it is kinda not what I'd want to do.
Please help!  It is strange this matter hasn't been brought up, at least I couldn't find anything using search.  Could only attach two pictures, the third that didn't go through showed str.h open in Notepad++ with OEM 866 encoding.


Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to manage OEM 866 encoding
« Reply #2 on: September 01, 2018, 06:00:26 pm »
Why do you hitchhike a other topic?
What is wrong with the suggested solution?
Codepages are a old concept that Microsoft suggest to no use them anymore....


As far as i can tell codeblockls lists all available codepages on your system. If cp 866 is not listed your system does not supports it...
Does notepad++ lists the cp 866?

Offline Xavier65

  • Single posting newcomer
  • *
  • Posts: 4
Re: How to manage OEM 866 encoding
« Reply #3 on: September 02, 2018, 12:12:14 am »
I hitchhike another topic, 'cause the search did not return any results for OEM 866 or 866 or 866 encoding.  This topic was created BEFORE I was aware there were the other two topics.
The solution doesn't work.  Both of them.

The Notepad++ lists 866.  Besides (the most important reason) the console lists OEM 866 as encoding in its properties.
« Last Edit: September 02, 2018, 12:24:27 am by Xavier65 »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to manage OEM 866 encoding
« Reply #4 on: September 02, 2018, 11:05:26 am »
Quote
The solution doesn't work.  Both of them.
Does not work is not a adequate answer to help you. Describe your problem and we might be able to help. The other two theards where able to use this solution...


Quote
The Notepad++ lists 866
Try again in codeblocks. For me it displayed it after i selected it in notepad++. I don't know why, but now it is shown in the drop down list. I still think this is a windows thing...

Offline Xavier65

  • Single posting newcomer
  • *
  • Posts: 4
Re: How to manage OEM 866 encoding
« Reply #5 on: September 05, 2018, 10:05:45 pm »
Nope.  It is either way:
1) It's all good in Notepad++ (Cyrillic symbols), but upon loading the main.c file with OEM 866 encoding the Code::Blocks editor shows abracadabra (see the screenshot).  Most importantly, the console shows correct symbols!
2) The Code::Blocks editor shows the Cyrillic right (within the code), but when I compile and run the console outputs abracadabra.
When I load the saved main.c file with OEM 866 encoding back into Code::Blocks the editor doesn't provide the Windows 866 encoding.

So, that's what I meant earlier.  It is half the solution.  What I need is to see nice and neat Cyrillic in the editor and the console app, not just in one of them.  And as a perfectionist I'd prefer to get permanent solution to the problem, i. e. tweak something (the Windows registry, the Code::Blocks config file etc) so that I don't have to use the twisted approach suggested in the other two threads (include something [I don't understand fully] in every C project itself [no matter how small] that I run for self-education purposes).  There's gotta be a solution, and I think it's very simple!

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: How to manage OEM 866 encoding
« Reply #6 on: September 06, 2018, 01:33:01 am »
I was talking about the settings in settings->Editor->Encoding settings->Use encoding when opening...

Well obviously on both threads i describe the same way to use utf-8 as default encoding.. this solves all problems, is permanent, and is able to use ANY language on the world to work without problems, or future modifications... And on both threads the user describe that my descriptions leads to success.... On top of all this all your projects will work on any operating system (mac, linux or windows) and you can not say this with the cp866 solution...

anyway... I don't see how codeblocks can change something. We use the wxWidgets default functions to read all system encodings. So if they are not listed in this list there is something wrong in the wxWidgets code. And we can do anything about this...