Author Topic: Is it possible to add a new codepage?  (Read 18186 times)

Offline coditoter

  • Single posting newcomer
  • *
  • Posts: 8
Is it possible to add a new codepage?
« on: July 19, 2014, 11:05:27 am »
Hello geeks!
I'm writing in help because I think that the problem should be there but it can be also put in new feature or sth like that subforum.
Well, the problem is quite simply. Windows console uses code page 852 or (it is also named OEM 852). You can not care it if you're an Englishman but ... I'm in Poland and if i use my special characters like "ąęźć..." I see strange characters. So, I must use also that code page  in C::B editor. Unfortunately, nowadays it's not supported. Is it possible to add that code page do C::B editor because I don't want to use Notepad++ to change code page, then compile, edit file, then change... you know. I cross compile to windows using linux but the problem also exists on windows.
Really thanks for answer. I think that the solution should be quite easy ;).

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353

Offline coditoter

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it possible to add a new codepage?
« Reply #2 on: July 19, 2014, 02:23:49 pm »
But that's nonsense. Why have I to use UTF-8, avoid cin & cout, change too many things ... if the best solution is to change code page?
That solution works perfectly and I only want to use new code page (Windows default) - OEM 852 in C::B. Is it REALLY hard to add it?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Is it possible to add a new codepage?
« Reply #3 on: July 19, 2014, 02:40:51 pm »
Quote
Windows console uses code page 852 or (it is also named OEM 852)

Install scintilla is the codepage supported? If not, it is unlikely CB will support it.

http://sourceforge.net/projects/wxscintilla/

The CB editor is a modified version of a wxscintilla.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Is it possible to add a new codepage?
« Reply #4 on: July 19, 2014, 03:46:12 pm »
The only related source file(s) that I found was editorconfigurationdlg.cpp and editor_configuration.xrc.

Note, backup the the file before trying to edit; note: CB must be closed while editing.
Editing the conf files is NOT recommended as a safe way to do changes.
The list appears to NOT be in the CB source file; so, I am guessing it is Operating System supplied.

I am NOT a CB Developer; this is NOT a safe thing to do (Edit the conf file).

Found in Windows CB default.conf file.
Code
		<DEFAULT_ENCODING>
<str>
<![CDATA[WINDOWS-1252]]>
</str>
</DEFAULT_ENCODING>

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Is it possible to add a new codepage?
« Reply #5 on: July 19, 2014, 03:53:18 pm »
I think I found the source of the list "wxFontEncoding".

I suggest building "wxWidgets/samples/font" is the font listed in the sample?
If not, it is likely an issue on your PC or in wxWidgets.

Edit2: I would guess it is a wxWidgets lack of support issue. But, I can not test it since I do NOT have that font on my PC.

Edit3: I would guess the lack of being listed in wxWidgets's common/fmapbase.cpp file is the likely cause of CB not listing it.

Tim S.
« Last Edit: July 19, 2014, 04:13:17 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Is it possible to add a new codepage?
« Reply #6 on: July 19, 2014, 04:21:12 pm »
The only related source file(s) that I found was editorconfigurationdlg.cpp and editor_configuration.xrc.

Note, backup the the file before trying to edit; note: CB must be closed while editing.
Editing the conf files is NOT recommended as a safe way to do changes.
The list appears to NOT be in the CB source file; so, I am guessing it is Operating System supplied.

I am NOT a CB Developer; this is NOT a safe thing to do (Edit the conf file).

Found in Windows CB default.conf file.
Code
		<DEFAULT_ENCODING>
<str>
<![CDATA[WINDOWS-1252]]>
</str>
</DEFAULT_ENCODING>

Tim S.

It's a wxWidgets list, if I recall correctly, so changing the conf-file will not work and probably lead to crashes.
What about iso8859-2  (latin-2) ?

Offline coditoter

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it possible to add a new codepage?
« Reply #7 on: July 19, 2014, 06:14:45 pm »
I tried iso8859-2 but it's not working correctly... generally, it's nosense to use other code page that OEM 852 because MS Console uses it (and wine implementation too probably). So it would be great upgrade 4 Win coders to use Win console code page :D.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Is it possible to add a new codepage?
« Reply #8 on: July 19, 2014, 06:16:54 pm »
I tried iso8859-2 but it's not working correctly... generally, it's nosense to use other code page that OEM 852 because MS Console uses it (and wine implementation too probably). So it would be great upgrade 4 Win coders to use Win console code page :D.

I gave you enough info; now do some work or shut-up!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Is it possible to add a new codepage?
« Reply #9 on: July 19, 2014, 09:30:50 pm »
I tried iso8859-2 but it's not working correctly... generally, it's nosense to use other code page that OEM 852 because MS Console uses it (and wine implementation too probably). So it would be great upgrade 4 Win coders to use Win console code page :D.

I gave you enough info; now do some work or shut-up!

Tim S.

don't be this rude... jens mentioned that this is a wxWidgets issue and can't be changed that easy...

@oditoter
There are many good reasons to NOT use the win default code page
And there are twice as much reasons to use utf8  (the windows console is a relict from win16 time, and windows should be forced to implement a new console with utf8...) you can read here some statements: http://utf8everywhere.org/

But that's nonsense. Why have I to use UTF-8, avoid cin & cout, change too many things ...
The nonsense here lays on Microsoft site... If you want code platform independent (as you mentioned earlier) then the easiest way is my approach, and then you have really Unicode support, and not this pseudo implementation from Microsoft... not use cin and cout are the lowest problem you will heave...

BUT if you find some way to set a new codepacge or any other way to successfully use unicode in the windows console, i would really be happy if you can post your solution here!!!!

greetings

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Is it possible to add a new codepage?
« Reply #10 on: July 19, 2014, 09:43:16 pm »
I tried iso8859-2 but it's not working correctly... generally, it's nosense to use other code page that OEM 852 because MS Console uses it (and wine implementation too probably). So it would be great upgrade 4 Win coders to use Win console code page :D.

I gave you enough info; now do some work or shut-up!

Tim S.

don't be this rude... jens mentioned that this is a wxWidgets issue and can't be changed that easy...

@oditoter
There are many good reasons to NOT use the win default code page
And there are twice as much reasons to use utf8  (the windows console is a relict from win16 time, and windows should be forced to implement a new console with utf8...) you can read here some statements: http://utf8everywhere.org/

But that's nonsense. Why have I to use UTF-8, avoid cin & cout, change too many things ...
The nonsense here lays on Microsoft site... If you want code platform independent (as you mentioned earlier) then the easiest way is my approach, and then you have really Unicode support, and not this pseudo implementation from Microsoft... not use cin and cout are the lowest problem you will heave...

BUT if you find some way to set a new codepacge or any other way to successfully use unicode in the windows console, i would really be happy if you can post your solution here!!!!

greetings

Did he try to compile the wxWidgets sample I posted before Jen posted!!!!

You are the rude person who has NOT read this thread!!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline coditoter

  • Single posting newcomer
  • *
  • Posts: 8
Re: Is it possible to add a new codepage?
« Reply #11 on: July 20, 2014, 11:00:33 am »
@stahta01
Sorry but the only rude person there is(are) ... you. You suggested changing conf files but It was a complete nosense. If the code page had been included in C::B it would be easy to change it there but it isn't (the same problem on Windows...). So I just ignored your opinion (I remind you that you said 'I'm not a C::B dev) waiting for someone who knows more. And jens confirmed what I thought.
@BlueHazzard
Could you help me to make code changing font to Lucida Console in my program (to console...)? I'm quite newbie in programming (you see... still in console) and I guess that it is included in windows.h . I tried on my own using prepared code but I failed.
Maybe it'd be nice workaround by the time I start coding windows apps ;)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Is it possible to add a new codepage?
« Reply #12 on: July 20, 2014, 01:14:14 pm »
@stahta01
Sorry but the only rude person there is(are) ... you. You suggested changing conf files but It was a complete nosense. If the code page had been included in C::B it would be easy to change it there but it isn't (the same problem on Windows...). So I just ignored your opinion (I remind you that you said 'I'm not a C::B dev) waiting for someone who knows more. And jens confirmed what I thought.
@BlueHazzard
Could you help me to make code changing font to Lucida Console in my program (to console...)? I'm quite newbie in programming (you see... still in console) and I guess that it is included in windows.h . I tried on my own using prepared code but I failed.
Maybe it'd be nice workaround by the time I start coding windows apps ;)

Are you all incapable of reading!!!

Lazy idiots and ignorant users; not willing to build a single wxWidgets sample are NOT worth my time!!!

Tim S.
« Last Edit: July 20, 2014, 01:29:42 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Is it possible to add a new codepage?
« Reply #13 on: July 20, 2014, 01:23:19 pm »
@stahta01
Sorry but the only rude person there is(are) ... you. You suggested changing conf files but It was a complete nosense. If the code page had been included in C::B it would be easy to change it there but it isn't (the same problem on Windows...). So I just ignored your opinion (I remind you that you said 'I'm not a C::B dev) waiting for someone who knows more. And jens confirmed what I thought.
@BlueHazzard
Could you help me to make code changing font to Lucida Console in my program (to console...)? I'm quite newbie in programming (you see... still in console) and I guess that it is included in windows.h . I tried on my own using prepared code but I failed.
Maybe it'd be nice workaround by the time I start coding windows apps ;)

Are you all incapable of reading!!!

Lazy idiots; not willing to build a single wxWidgets sample are NOT worth my time!!!

Tim S.

Please calm down.
There's no need to get aggressive or offending.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: Is it possible to add a new codepage?
« Reply #14 on: July 20, 2014, 01:33:13 pm »
I am finished helping this site for a while; I get insulted for posting the rules to ignorant users!!

It is just NOT worth the hassle trying to help the new posters on this site; they are just too ignorant of the rules of this site.

And they are just too ignorant of programming.

And, they seem unable to read and understand my replies.

I wasted over an hour trying to help the OP and they appears to NOT even have read my posts.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org