Author Topic: Unicode ?  (Read 11223 times)

0 Members and 1 Guest are viewing this topic.

Offline Bert22306

  • Forum Regular
  • Posts: 206
    • View Profile
Re: Unicode ?
« Reply #30 on: September 13, 2018, 11:25:36 pm »
We had various code pages back in those days.  Unicode was basically an attempt to merge all those individual pages into one, and came a bit later.
https://en.m.wikipedia.org/wiki/Code_page

I looked into this some time back, and it looks like CP437, the default one, has the most frequently used accents already in it. Then the other CPs extend the list of special characters, using the same numbered locations as CP437 for those symbols, but replacing some of the other stuff in CP437. Like replacing the Greek letters, various lines and blocks, and other such symbols, using those locations for more special accented characters.

It looks to me like anything required even for French already exists, in CP437. Not sure why a French keyboard should not be able to be fooled, to use CP437. Might not be perfect, but it should be enough for everyday writing.
« Last Edit: September 13, 2018, 11:28:24 pm by Bert22306 »

Offline RhoSigma

  • QB64 Developer
  • Forum Resident
  • Posts: 565
    • View Profile
Re: Unicode ?
« Reply #31 on: September 14, 2018, 01:48:39 am »
It looks to me like anything required even for French already exists, in CP437. Not sure why a French keyboard should not be able to be fooled, to use CP437. Might not be perfect, but it should be enough for everyday writing.

Yes, its enough for german and other european languages too, but fact is it doesn't work. And I'm sorry to bring this up and up again to scratch your nerves, it DID WORK in SDL, I can happily type german umlauts in the SDL version and they will correctly be displayed with the IDE set to its standard CP437. It even works first pressing the accent pre-selection key and after that pressing the "A" to get the "Á", but all this is broken since the transition to GL, which is 6 years ago, and nothing has changed since then.

For me it seemes that SDL has returned "raw" key codes according to the selected keyboard type, which then were ramapped by the QB64 input routines to CP437. Now with OpenGL I get the impression that it already returns ASCII key codes according to the systems default code page (in my case WIN-1252), which are not even touched anymore by the QB64 input routines to remap them too CP437, but instead these OpenGL returned values are placed onto the CP437 as is, which obviously gives the wrong char, because the value was already remapped to WIN-1252 by OpenGL. However saving a file with such wrong chars in the IDE and then reopen it with the Windows editor shows the correct chars. That's what convinces me that GL does any kind of system realated "pre-mapping", which SDL did not. This difference between SDL and GL must be sorted out, maybe GL has already another function which would us return the "unmapped" key codes as SDL did.
My Projects:   https://qb64forum.alephc.xyz/index.php?topic=809
GuiTools - A graphic UI framework (can do multiple UI forms/windows in one program)
Libraries - ImageProcess, StringBuffers (virt. files), MD5/SHA2-Hash, LZW etc.
Bonus - Blankers, QB64/Notepad++ setup pack