Skip to content

Commit

Permalink
codebase ISO-8859-15 Fixes #18
Browse files Browse the repository at this point in the history
  • Loading branch information
freakout42 committed Jan 23, 2025
1 parent 3034103 commit 538fdc0
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 5 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,30 @@ You need i686 glibc installed on 64bit machines: `sudo yum install glibc.i686`
`docker run -e COLUMNS -e LINES -e TERM -ti ghcr.io/freakout42/macrocalc:latest`

6. Windows .exe Download
https://github.com/freakout42/macrocalc/releases/download/v10.51/mc-10.52-w3-i386.exe.zip
https://github.com/freakout42/macrocalc/releases/download/v10.53/mc-10.53-w3-i386.exe.zip
and unzip mc.exe and mc2wks.exe. Start it with any console with full
pathname or double-click it with the explorer.

Non-ascii characters
--------------------

The sourcecode of MacroCALC is from 1979 - there is no unicode (UTF-8) support.
For international characters configure your terminal for an 8-bit codebase:

If you are using PuTTY you must set for the session:

Window->Translation->Remote character set = ISO-8859-15

With the MacOS Terminal application:

Settings->General->Profiles->International->
Text Encoding = Western (ISO Latin 9)
X Set locale environment variables on startup

Start a local xterm with:

LC_ALL=en_US.iso885915 LANG=en_US.iso885915-US xterm

Getting started
---------------
Navigate through the sheet with the arrow-keys. The dot (.) marks the
Expand Down
2 changes: 1 addition & 1 deletion arx/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# for: $Os

ARXREL=8
ARXVER=7
ARXVER=8

ARX=../../arx
DIRS=inc src lib
Expand Down
3 changes: 3 additions & 0 deletions arx/src/cur_getk.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ register int ch;

wrefresh (w);
ch = wgetch (w);
#ifdef WIN32
if (ch < 0) ch = 256 + ch;
#endif
switch (ch)
{
case KEY_BS: return KEY_BACKSPACE;
Expand Down
12 changes: 12 additions & 0 deletions arx/src/cur_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,18 @@ if (around >= 3)

cur_redir = around;

#ifdef WIN32
#define ISO_8859_15_CP 28605
/*if (IsValidCodePage(ISO_8859_15_CP) == 0) return NULL;*/
SetConsoleCP(ISO_8859_15_CP);
SetConsoleOutputCP(ISO_8859_15_CP);
#else
#define ISO_8859_15_CP "en_US.iso885915"
setenv("LC_ALL", ISO_8859_15_CP, 1);
setenv("LANG", ISO_8859_15_CP, 1);
/* ESC % @ */
#endif

if ((stdscreen = initscr()) == NULL) return NULL;
#ifdef DEBUG
fprintf (stderr, "cur_init: %s\n", "initscr() done");
Expand Down
19 changes: 19 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,25 @@ Here is an example for Linux/bash:

**REMEMBER TO START MacroCALC WITH THE `-u` OPTION TO USE THE UNIT FUNCTIONALITY**

### non-ascii characters

Since the sourcecode of MacroCALC is from 1979 there is no unicode (UTF-8) support.
To get international characters configure your terminal for an 8-bit codebase:

If you are using PuTTY you must set for the session:

Window->Translation->Remote character set = ISO-8859-15

With the MacOS Terminal application:

Settings->General->Profiles->International->
Text Encoding = Western (ISO Latin 9)
X Set locale environment variables on startup

Start a local xterm with:

LC_ALL=en_US.iso885915 LANG=en_US.iso885915-US xterm

### getting started

Navigate through the sheet with the arrow-keys. The dot (.) marks the
Expand Down
2 changes: 1 addition & 1 deletion mc/Name
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mc v10.52
mc v10.53
4 changes: 2 additions & 2 deletions mc/src/mcfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ if (prompt == 2) {
sprintf(msgcmd, "%s -r <%s", mc2wkspath(0), filename);
file = popen(msgcmd, "r");
} else {
file = fopen(filename, "r");
file = fopen(filename, "rb");
}
if (file == NULL)
{
Expand Down Expand Up @@ -137,7 +137,7 @@ if (prompt == 2) {
sprintf(msgcmd, "%s >%s", mc2wkspath(0), filename);
file = popen(msgcmd, "w");
} else {
file = fopen(filename, "w");
file = fopen(filename, "wb");
}
if (file == NULL)
{
Expand Down

0 comments on commit 538fdc0

Please sign in to comment.