TSE: The changed behavior regarding e.g. line drawing might be explained by the fact that Microsoft before used Code page 437 and lately it has changed to Code Page 850

21 views
Skip to first unread message

knud van eeden

unread,
Jun 25, 2025, 5:14:55 PM6/25/25
to SemWare TSE Pro Text Editor
TSE: The changed behavior regarding e.g. line drawing might be explained by the fact that Microsoft before used Code page 437 and lately it has changed to Code Page 850

Hello,

The goal is to get Code Page 437 when
testing it using

  menu > 'Util' > 'ASCII chart'

then scrolling down to the last characters e.g. 250, 251, ..., 255
and checking if those characters are from a Code Page 437
instead of the default Code Page 850.

The font used is always Terminal, fontsize 9 and bold.
TSE for Microsoft Windows version 4.50.6.

The intended method is trying to brute force TSE to be in the Code Page 437 state
(instead of the default Code Page 850 state)

1. One can get the code page by typing in cmd.exe

 chcp

that will typically show here

 850

(thus code page 850 is active)

2. One can set a code page, e.g. to 437
by typing 

 chcp 437

3. So one idea was to force TSE to use code page 437
something like on the cmd.exe command line:

 chcp 437 & g32.exe

That first sets the code page to 437, then calls TSE g32.exe.

4. But that did not work, when checking the 'ASCII chart'.

5. Then tried from within TSE to go to the shell using <F9> and 
then typing on the command line

 chcp 437

and then exit.
But that does not work because Shell() or Dos() is a separate process,
so has not influence on the parent process (TSE g32.exe).

6. Then I used a DLL to set the code page from within TSE

a. Create foobar.s

b. Insert the text

---
dll "<kernel32.dll>"
  integer proc SetConsoleOutputCP( integer wCodePageID ) : "SetConsoleOutputCP"
  integer proc SetConsoleCP( integer wCodePageID ) : "SetConsoleCP"
end

PROC Main()
  SetConsoleOutputCP( 437 )
  SetConsoleCP( 437 )
  Warn( "Code page set to 437" )
END
---

Compile it and run it, it will show that code page 437.

7. But that did not work to change the code page to 437

8. Then I created a tsestart.s, copied the DLL text from
above in it, saved it in the same directory as g32.exe
and compiled it, then started TSE.
That will automatically run tsestart.mac, by design.
It showed 'Code page set to 437' as expected.

But inside TSE checking the menu > 'Util' > 'ASCII chart' 
showed still the characters from Code Page 850
(and not from wanted 437 thus).

Any suggestions?

Thanks
with friendl greetings
Knud van Eeden





Carlo Hogeveen

unread,
Jun 25, 2025, 6:40:06 PM6/25/25
to sem...@googlegroups.com

Firstly, which of the two “Microsoft Windows version 4.50.6” [TSE] versions?
Look in the start-up screen or the Help About menu.
In Windows, if they say "(Console)", then it is the Windows Console version of the editor, otherwise it is the Windows GUI version of the editor.

Secondly, all your questions and experiences are explained here:
https://ecarlo.nl/tse/files/CodePages.html

Carlo



knud van eeden

unread,
Jun 26, 2025, 5:40:47 AM6/26/25
to sem...@googlegroups.com
Firstly, which of the two “Microsoft Windows version 4.50.6” [TSE] versions?

1. It is or should always be TSE for Microsoft Windows version 4.50.6 (currently latest available version thus).

2. For example its counterpart 

     TSE for Linux version 4.50.6 

I can not use so is or should never be mentioned.
Because it does not work at all here and has also never worked 
(all kind of errors regarding not finding internal TSE macros, like iconfig, ...).

I could maybe try again using 'tar' instead of 'unzip' to unzip the installation.zip, maybe that is the issue.

So if it is regarding TSE for Linux it is always about TSE for Linux version 'official release' at this moment.

===


OK, I will check it.

Thanks
with friendly greetings
Knud van Eeden





--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.

To view this discussion visit https://groups.google.com/d/msgid/semware/000401dbe622%24170b1380%2445213a80%24%40ecarlo.nl.

Carlo Hogeveen

unread,
Jun 26, 2025, 6:16:18 AM6/26/25
to sem...@googlegroups.com

>> Firstly, which of the two “Microsoft Windows version 4.50.6” [TSE] versions?

> 1. It is or should always be TSE for Microsoft Windows version 4.50.6 (currently latest available version thus).

Again, which one are you talking about?
Let me try another way.
The "TSE for Microsoft Windows version 4.50.6" that you start with g32.exe or the "TSE for Microsoft Windows version 4.50.6" that you start with e32.exe?
These are typically called the GUI and the Console versions of Windows TSE respectively.

Carlo



knud van eeden

unread,
Jun 26, 2025, 9:27:43 AM6/26/25
to SemWare TSE Pro Text Editor
This case can be closed.

This has been resolved by setting the code page globally on Microsoft Windows to code page 437.

TSE reads that and it seems to be the only way to enforce that in TSE.

Now drawing using the Terminal font uses code page 437 where the correct drawing characters are present and used and the drawing is again as expected.

Note: Setting it to code page 437 has effects on the appearance of the Terminal font, e.g. setting it to bold is not necessary anymore and it will show larger.


Carlo Hogeveen

unread,
Jun 26, 2025, 10:12:05 AM6/26/25
to sem...@googlegroups.com

Glad I and my Codepages webpage could help,

Carlo

https://ecarlo.nl/tse/files/CodePages.html#QueryAndSet



Knud van Eeden

unread,
Jun 27, 2025, 12:42:16 PM6/27/25
to sem...@googlegroups.com, Knud van Eeden
So the root cause was that if you set the global Locale not to 'English (United States)' then the global Code Page (see also your 'CodePages' entry on your website) is ALWAYS 850.

TSE seems to IGNORE completely you setting the Code Page in any other way than the global Locale setting (e.g. CHCP 437 via the command line, a batch script, via the Microsoft Windows DLL, ... you name it).

If not doing it that way then the involved fonts (e.g. Terminal, Perfect DOS VGA 437, ...) will ALWAYS show Code Page 850 out of the box.

FYIO: Because wanting to avoid a restart of the computer: regarding setting the global locale in any other way than via the Windows menus, so thinking about via the registry a. setting the locale in the registry and b. setting the code page via the registry. But there were severe warning about not to do that as it might corrupt Microsoft Windows.

FYIO: I checked the earlier TSE 4.4 and checked menu > 'Util' > 'ASCII chart' and when my global code page was still 850 it showed e.g. the Terminal font in TSE also with Code Page 850.
And I knew that drawing had worked without issues before. So what had changed.
The answer is that it must have been thus some global Code Page setting probably.
Indeed setting the code page globally gave immediately back the correct drawing options with the Terminal font also in the latest TSE for Microsoft Windows 4.50.6 and before.

with friendly greetings
Knud van Eeden
--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.

Knud van Eeden

unread,
Jun 27, 2025, 12:43:28 PM6/27/25
to sem...@googlegroups.com, Knud van Eeden
Yes, thanks.

Very informative information there, especially about setting the code page globally in Microsoft Windows.

with friendly greetings
Knud van Eeden
--

---
You received this message because you are subscribed to the Google Groups "SemWare TSE Pro text editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to semware+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages