VOGONS

Common searches


First post, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

Whenever I work with DOSBox I usually deal with english only and sometimes dutch. For those languages the basic (32-127) ASCII character set is usually good enough for my purposes. However, when I do want to create or edit text files for DOS programs in a language that requires characters from the extended character set (128-255) I have noticed that Notepad (Windows) usually isn't able to properly decode and display extended characters and encodes special characters in a way that isn't supported by DOS based programs when saving.

In short, I am looking for a program (preferably for Windows) that will display extended characters in a text file as they would be using a specific code page in DOS and will save them in such a way they a DOS program will display them properly (assuming the correct code page is set of course.)

A DOS based editor is acceptable too, however I have noticed that using the KeyB command in DOSBox changes the keyboard layout along with any extended characters being displayed. This is rather annoying when typing on a keyboard with a USA english layout. I don't mind memorizing a few special character codes and entering them using ALT+numpad code. It would however be nice if I can verify the correct character has been entered when seeing the result on screen.

(This is related to an earlier post I made about changing code pages using Quick Basic.) Also, if anyone wants to know what I want this for, I am going to try translating a DOS program I wrote to another language. I have already done a translation to Spanish once, and I remember special characters giving a lot of trouble whenever having to use a Windows based (sometimes I had to resort to an online dictionary or Google Translate) program to modify text.

EDIT:
https://github.com/PeterSwinkels/Topography-3 … tree/main/Topo3 (a Quick Basic 4.5 program I wrote years ago (1996) that supports multiple languages and have been slowly updating and extending)

Last edited by Peter Swinkels on 2022-04-24, 08:22. Edited 2 times in total.

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 2 of 13, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

@Ringding:

Thank you for answering my message. I am afraid however that you are correct. I don't really like the idea of having to use Emacs.

However an idea occurred to me:

I could try developing a utility that decodes special characters to escape sequences which can be converted back to characters again. I wrote such functions several times before: https://github.com/PeterSwinkels/Cartooners-F … 0Viewer/Core.vb (Escape() and Unescape()), for example. Come to think of it, such a program would also have to handle line breaks correctly.

Or are there programs which can do that already?

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 3 of 13, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

While they're still in the early stages of development these two utilities I wrote look promising for my purposes. As they currently work you use "Escape.bas" to convert any character outside the 32-127 range (except for line breaks (13)) to a hexadecimal escape sequence. The resulting text written to stdio (displayed on screen.) This means you need to redirect the program's output to a file if you want to save it. "Unescape" works the same way but does the opposite.

With a little more work I think these programs will be useful for dealing with small files containing a few special characters. Binary data or large files would probably be too impractical and slow.

Of course feedback, suggestions, or questions are always welcome!

Attachments

  • Filename
    UNESCAPE.BAS.txt
    File size
    1.41 KiB
    Downloads
    43 downloads
    File comment
    Rename to *.bas
    File license
    Public domain
  • Filename
    ESCAPE.BAS.txt
    File size
    943 Bytes
    Downloads
    45 downloads
    File comment
    Rename to *.bas
    File license
    Public domain

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 5 of 13, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

This one? http://www.jedit.org/ - It looks promising. Thanks for the tip BloodyCactus!

EDIT:
Unfortunately jEdit requires something called "jdk 11". The page the jEdit installer sends me doesn't appear to have an installer available. For now, I am going to stick to my idea of just using escape sequences.

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 6 of 13, by dr_st

User metadata
Rank l33t
Rank
l33t
Peter Swinkels wrote on 2022-04-23, 10:33:

I have noticed that Notepad (Windows) usually isn't able to properly decode and display extended characters and encodes special characters in a way that isn't supported by DOS based programs when saving.

What about Notepad++? It has a pretty extensive "Encoding" menu with "Character sets" submenus, but I have not investigated its ability to deal with all sorts of code pages, nor its DOS compatibility.

https://cloakedthargoid.wordpress.com/ - Random content on hardware, software, games and toys

Reply 8 of 13, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

@dr_st:
Notepad++ installed without problems and I am going to give it a try. Thank you!

@_rob:
Thanks for the tip, unfortunately I have already been on that page it appears to be nothing but some generic information. Do you have a direct link to the page containing the jdk installer?

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 9 of 13, by _Rob

User metadata
Rank Member
Rank
Member

https://jdk.java.net/archive/ has the old versions. Note that Java 17 is considered the current LTS (Long-Term-Support) release, and unless jedit really needs JDK11, I would use JDK17 instead.

Reply 10 of 13, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

@_rob:
Thank you, but I found that page too the last time I was trying to install jdk. Those archives just contain a bunch of files but no installer. I have no idea what I would need to do with those to get jEdit to work.

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 11 of 13, by _Rob

User metadata
Rank Member
Rank
Member

That is because Oracle is being Oracle, and made things very convoluted in attempts to cash in on Java. They want you to use the Oracle branded version.
e.g., https://www.oracle.com/java/technologies/java … -downloads.html

See here for an alternative to Oracle:
https://adoptium.net/temurin/releases

For Linux it's easy, your distro will supply you with the openjdk version in it's package manager.

Reply 12 of 13, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

@_rob:
Thank you, perhaps I will look at your links later. I am looking into my own personal solution for now. Also, at this moment I prefer to stick with Windows because switching to Linux might make it easier to install jEdit, but will bring a whole set of another issues with it instead.

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels

Reply 13 of 13, by Peter Swinkels

User metadata
Rank Oldbie
Rank
Oldbie

I have decided to try to write my own custom solution to the problem described in my earlier posts instead of using an editor such as Notepad++ or jEdit.

Short description of the problem at hand:
1. The text files for a DOS based program need to be translated into a language which uses a few special characters that cannot easily be entered using a USA English keyboard.
2. Notepad cannot decode or encode extended characters (128-255) in a manner suitable for text files used by DOS programs.
3. Some text has to be entered using a Windows program as using a DOS based editor only is too impractical when copy/pasting from a web browser.

The solution:
1. A program that reads a text file that may or may not contain extended characters and outputs another text file in which any such characters are encoded in a way convenient for editing and that can easily be read by a Windows or DOS program.
2. This program can convert text files with "encoded" extended characters back to a text file containing such characters in a manner a DOS program can handle.

Note:
The program as provided contains a few other features specific to what I intend to use it for and has not been fully tested yet.

The specific features are:
1. The extension of the original unencoded file is placed at the top of the encoded output file.
2. This extension is used to determine the output file's name when decoding.
3. Of the control characters (0-31) only the Tab and Line Break characters are encoded. (9 and 13). Other control characters are skipped as being "unsupported."

To everyone who has responded: Thank you. Your suggestions are appreciated!

Attachments

  • Filename
    TOPO3TXT.BAS.txt
    File size
    4.4 KiB
    Downloads
    42 downloads
    File comment
    A custum solution written in Quick Basic 4.5.
    File license
    Public domain

Do not read if you don't like attention seeking self-advertisements!

Did you read it anyway? Well, you can find all sorts of stuff I made using various programming languages over here:
https://github.com/peterswinkels