Jump to content
IGNORED

AAC (ASCII ATASCII Converter) for our modern computers


fujidude

Recommended Posts

Well hello my fellow Atarians. If you're like me you still use the old Atari (either real thing or emulated), but you also use a modern computer like a Windows PC, Linux PC, or Mac. In that case you probably have cause to use text files from one system on the other and visa versa.

 

As some of you know, I developed a program for the A8 to do converting called AAC. You can get info on that over in it's own topic. This new topic is about a different program with the same name that does the same job, but runs natively on the new machines. It is written in Python so has the ability to be cross platform.

 

So here is AAC v0.1, 32-bit Windows, for your testing pleasure. It works fine as expected in every case I have tested so far, but I like to get feedback from others too. Once any bugs (if any) are ironed out. It will get it's v1.0 release.

 

If you need a Linux version to test let me know.

Edited by fujidude
  • Like 5
Link to comment
Share on other sites

Well after seeing some download activity on the previous release, but no feedback, I can only conclude no issues were discovered and hopefully people are happy with the program. I have done some more and now packaged it up in an installer. The installer simply extracts the files and no messing with the Windows start menu or registry is done. Source code is included. I have made both a 32-bit and 64-bit version. I will attach the files, but also paste in the readme.txt and change.log in this posting.

AAC (ASCII ATASCII Converter) is copyright 2015 Fujidude.
It is licensed under the GNU GPL3+, a copy of which is included as a
separate file.  There is also another work with the same name and purpose
which excecutes on Atari 8-bit computer systems.  That work is also
copyrighted by Fujidude and under the GPL3+, and there is no conflict of rights.

The AAC icon(s), are orginal work by one named "Untergunter" as found on
www.iconarchive.com.  They are modified by Fujidude to include a blue AAC logo
placed over them.  The original work, and also this modified icon set, are
licensed under the Creative Commons Attribution-Noncommercial-Share Alike 4.0.
A copy of this license also, is included as a separate file.

Although AAC is a command line driven aplication, it is not a DOS program.  It
requires a CMD shell under windows, or a terminal command line under Linux or
Mac OS-X (according to the distribution in use).
Change log for AAC (ASCII ATASCII Converter) by Fujidude

VERSION	DESCRIPTION
=======	======================================================================
1.0	First public release.
		
	Enahncements:
	- Included informational notices which print out on the console as the
	  program executes various processing points.
	- Added --quiet option which supresses all informational notices except
	  for the program title info, and important error messages.
	- Added ability to intelligently choose a output translation based on
	  source file and which operating system is in use.
	- Target file name can be the same as the source file name if one
	  wishes to convert "in place."  This is possible because the entire
	  source file is read into memory and closed, before the target file is
	  ever opened.
		
	Bug fixes:
	- None (knock knock).
		
0.1	Alpha release.

Please note, due to the forum not accepting the .exe files, I tacked on a .txt after that on them. So, just remove the last ".txt" from the filenames after you download them.

install aac v1.0 win32.exe.txt

install aac v1.0 win64.exe.txt

  • Like 1
Link to comment
Share on other sites

I should add:

 

I used a bit of software called "Pyinstaller" to create stand alone executables. Also, anyone who has a somewhat recent version of Python 3 installed can run the source code scripts directly. If you wish to do so, please fix an issue in the script to help make it work right in all environments (Win, Linux, OS-X, etc.):

 

The 1st line of aac.py is #!/usr/bin/env python3

It think it needs to be changed to #! /usr/bin/env python3

 

On Windows systems, if a recent version of Python 3 was installed properly, .py files should already be associated with the Python Windows launcher, and the launcher should be already in the path. This means you can use aac.py directly in the same way you could use aac.exe. I understand not everyone has Python installed (but hey, you probably should!), and even the ones who do might want an easy way to take the program with them on a flash drive for use elsewhere. Thus the stand alone .exe file.

 

Questions and comments are welcome and encouraged.

Edited by fujidude
Link to comment
Share on other sites

I have an update on the magic 1st line of the script, which pertains to running the script directly without having to manually invoke it as an argument of python. For Windows it should be like this:

 

#!/usr/bin/env python3

 

for Linux, it should be:

 

!/usr/bin/env python3

 

Now that I am testing it in Linux, I'm running into some issues. I'll keep at them, but this was primarily targeted towards Windows users.

Edited by fujidude
Link to comment
Share on other sites

I have no need to use such a utility but I do thank you indeed for your generous efforts here.

 

Thanks for that, I appreciate it. The strange thing is, there is a thread where exactly this kind of thing was asked for and no one there had anything to say. I did post in there so they would be aware of its existence. Oh well.

Link to comment
Share on other sites

This program is ok for straight ASCII to ATASCII but if the file has any Atari character below or above the Alpha characters then the bytes are scrambled and not readable on the Atari .. Mostly with Basic listings but my Atari created Calendars are not viewable with My PC text editor..

Link to comment
Share on other sites

The strange thing is, there is a thread where exactly this kind of thing was asked for and no one there had anything to say. I did post in there so they would be aware of its existence. Oh well.

Unfortunately you were responding to a question the OP had posed more than a year earlier when starting the thread, and he'd already received almost an entire page full of recommendations within a week of lodging his initial request. It turns out that several suitable tools already exist, and while there's always room for one more tool - and always room to improve on what already exists - one should not be disheartened when a tool to accomplish what is a fairly mundane operation fails to elicit a great deal of praise or discussion. Good software should speak for itself, and lamenting a lack of attention is unlikely to generate the kind of attention which is lacking. It may simply be that the software works perfectly as intended. I myself use Dratex, but if a day ever arrives on which I need to perform a conversion using the terminal, I'll know where to come. :)

  • Like 1
Link to comment
Share on other sites

I ran a simple conversion test. I used listed "Arabic" basic file (ANA.LST):

Since the program considers it as an ASCII file, I started the conversion from there as a first step.

The original file is named ANA.LST and the converted file is ANO.LST (as an ATASCII product file).

 

Note: If any one interested to see the arabic letters displayed :-D , then please run MEMO PAD r9 and choose ARABIC font from View menu.

 

The result was loss of many graphical characters from the ATASCII product file (ANO.LST). If you examine line 19003 (USR call), many characters were lost,

 

Then, ANO.LST was converted again "back" to ASCII (ANO.LST to ANY.LST, the missing characters were continued to be missing.

 

So, there was no way to obtain the original file ANA.LST because many characters are lost during the conversion process.

Here is the image of the conversion stages.

 

post-37046-0-56902700-1447186764_thumb.png

 

Also, attached are the 3 LST files.

 

Suggestion: Maybe AAC program should be able to insert words such as (CTRL09) or (CTR10) for non printed characters with a preceeded 9B characters (during conversion to ASCII) to identify it as an ATASCII characters. Thus, if they are converted back to ATASCII, the program will identify the case successfully and not being lost.

 

madi

aac.rar

Link to comment
Share on other sites

Unfortunately you were responding to a question the OP had posed more than a year earlier when starting the thread, and he'd already received almost an entire page full of recommendations within a week of lodging his initial request. It turns out that several suitable tools already exist, and while there's always room for one more tool - and always room to improve on what already exists - one should not be disheartened when a tool to accomplish what is a fairly mundane operation fails to elicit a great deal of praise or discussion. Good software should speak for itself, and lamenting a lack of attention is unlikely to generate the kind of attention which is lacking. It may simply be that the software works perfectly as intended. I myself use Dratex, but if a day ever arrives on which I need to perform a conversion using the terminal, I'll know where to come. :)

 

Sigh. I did notice the OP had started the thread that long ago and there were responses. But I also noticed a couple of other relevant facts. One was that there was a fair amount of recent activity in that thread. Another is that none of the programs mentioned offered some of the functionality that mine did, like being command driven, and supporting line drawing characters that are in common between ASCII and ATASCII (the single line box drawing characters with square angles).

 

While I admit, I was a little disappointed in the lack of response, I think disheartened might be a bit strong. Or maybe it is a good word for it. Anyway, I wasn't expecting a "great deal of praise or discussion". I was kind of expecting maybe a just a little along the lines of "I tried it... works good", or "I found a bug", or just a question perhaps. But you know, yes, your insight as to my motives for sharing here are basically correct. My efforts in creating the software were in part, and mostly my entire decision to share it here, were to gain the respect of my peers (old Atarians) and provide something useful to them. Is that weird? But I have to say, you nailed correctly and called me out on it. So I have to be honest that I'm a bit embarrassed now.

 

As to good software speaking for itself... well I honestly thought it was good. Certainly it is software to handle a fairly mundane task as you rightfully pointed out, and not more complex like your software (LW, U1MB BIOS, UFlash, etc. etc.), or as amazing as DLT's SDX or Avery's Altirra, etc. But for what it is supposed to do, I thought it does it well. I wouldn't have shared it if I thought it was lousy or just too lame. BTW, I think your software (that I have seen anyway) is very well done. I don't currently have the knowledge or skill to do things like that. But I just wanted to do what I could. I do hope you (or anyone) find it useful sometime.

  • Like 1
Link to comment
Share on other sites

@MADI... Hi there. Thanks for trying it out. The purpose of AAC is to convert text files between ATASCII format and ASCII, with support for some line drawing characters (the only ones in common between ATASCII and ASCII). Primarily this means supporting upper and lower case letters, numerals, tabs, common punctuation and such. It is not meant to support control characters, international characters (or character sets), or graphical characters (other than what I already identified). Unsupported characters are removed in the translation (both ways) intentionally, as they are unable to be properly displayed by the "other" system in normal use. But, when it comes to "text" files, that usually poses little or no problem, because straight text so to speak is commonly supported by most systems, even if some characters have different code values or the EOLS are encoded differently.

 

Software like ATASCII View and MEMO PAD have the ability specially handle displaying ATASCII on modern computers. I am not aware of any program for the A8 to properly display all the ANSI chars on that platform though. In cases where special characters are highly integral to the document, like your example of source code that uses potentially and of the 256 possible characters, then such software is the right tool for that job.

 

I should probably have included a help file which better communicates these things. I did include one with the sister program written for the A8, but didn't do much here for this line. I'll be correcting that.

 

Also, keep in mind I am writing this prior to examining your examples more thoroughly. I will do so and come back here and comment further. Thanks again for the feedback!

 

**EDIT... I want to point out that AAC deals with original ASCII for PCs. What that means specifically is what is known as "code page 437." See these links:

 

https://en.wikipedia.org/wiki/Code_page_437

http://www.ascii-codes.com/

 

Unicode is not delved into at all. Maybe someday though.

Edited by fujidude
Link to comment
Share on other sites

This program is ok for straight ASCII to ATASCII but if the file has any Atari character below or above the Alpha characters then the bytes are scrambled and not readable on the Atari .. Mostly with Basic listings but my Atari created Calendars are not viewable with My PC text editor..

 

Hi rdea6, see my post to Madi about what the conversion includes (and doesn't).

Link to comment
Share on other sites

  • 2 weeks later...

Happy Thanksgiving everyone!

 

Here is the new 1.1 version. I'll insert the change log in this message body. As before I am including stand alone executables for Win32 and Win64. I'm also including a Linux version which will just have the script. Linux already comes with Python pre-installed, so there is no need to make a stand alone executable. I have tested the script on Python 2.7 and 3.4 and it runs the same either way. This version would probably run fine on OS-X and even Unix flavors (assuming their Python isn't too old), but this is untested. I have tested this under Win 8.1 Pro x64, and Linux Mint 17.2 x64.

Change log for AAC (ASCII ATASCII Converter) by Fujidude

VERSION	DESCRIPTION
=======	======================================================================
1.1		2015-11-22
		
		Bug fixes:
		- On Linux, the program could be run from Python, but if called
		directly, relying on the "shebang" line, a file or folder not found
		error would raise.  This error was pre Python, and presumably raised
		from bash.  As it turns out, the issue was that the script had DOS/Win
		style EOLs.  This caused bash not to properly interpret the "shebang"
		line.  This was fixed by converting the script file to use Unix style
		EOLs.
		- On Linux, ran into issue where the specification of the file modes
		was erroring.  Believe this was due to using "br" rather than "rb".
		Changed code to explicitly specify mode with "mode=".
		
		Informational:
		- Modified the help text to better inform the user as to the behavior
		and limits of the software.

1.0		First public release.
		
		Enhancements:
		- Included informational notices which print out on the console as the
		  program executes various processing points.
		- Added --quiet option which suppresses all informational notices except
		  for the program title info, and important error messages.
		- Added ability to intelligently choose a output translation based on
		  source file and which operating system is in use.
		- Target file name can be the same as the source file name if one
		  wishes to convert "in place."  This is possible because the entire
		  source file is read into memory and closed, before the target file is
		  ever opened.
		
		Bug fixes:
		- None (knock knock).
		
0.1		Alpha release.

 

 

 

 

As usual, the forum would not allow .exe files to be uploaded, so I appended .txt onto them. Simply rename them to drop the last .txt.

Link to comment
Share on other sites

Hi,

 

I have a table of "approximations" from the ATASCII set to Unicode codepoints, it can be used to convert the "graphic" characters from atari to an univode (UTF-8 or UCS2) file, you could use it in your program. The characters are:

 

 

 

♥├ ┘┤┐╱╲◢▗◣▝▘ ▂▖

♣┌─┼●▄▎┬┴▌└␛↑↓←→"

!\"#$%&'()*+,-./

0123456789:;<=>?

@ABCDEFGHIJKLMNO

PQRSTUVWXYZ \ ^_

♦abcdefghijklmno

pqrstuvwxyz♠|⇱◀▶

♥┣▊┛┫┓╱╲◤▛◥▙▟▆ ▜

♣┏━╋●▀ ┳┻▐┗␛.␛⇑⇓⇐⇒"

░!\"#$%&'()*+,-./

??????????:;<=>?

@???????????????

??????????? \\ ^_

♦???????????????

???????????♠|⇱◀▶"

 

(edited to remove "[" and "]" because at post time, some characters were changed)

 

Note the "bold" characters that I selected for the inverse-video letters and numbers.

 

You could add an option to your program to process the files with this set.

 

Attached is a file with Windows BOM and line endings.

atascii.txt

Edited by dmsc
Link to comment
Share on other sites

dmsc: I must be missing something. I see a list of characters, not a translation table. It would help if you could provide a specific example (or a few) of a character translation you would like to see AAC do, but that it currently doesn't. It would help me to understand what you are getting at.

Link to comment
Share on other sites

I guess I didn't test it thoroughly enough in Python 2.7. I have removed the latest download files. It will need a version 3 Python after all. I will get fixed ones up tomorrow that use 3. In the mean time, for those who have already got the 1.1, the "shebang" line should read:

 

#!/usr/bin env python3

 

instead of:

 

#!/usr/bin/env python

 

The Windows ones were packaged with a 3.4 runtime, so should work. But I am still going to replace those so that references to 2.7 are removed.

Link to comment
Share on other sites

Hi!

 

dmsc: I must be missing something. I see a list of characters, not a translation table. It would help if you could provide a specific example (or a few) of a character translation you would like to see AAC do, but that it currently doesn't. It would help me to understand what you are getting at.

Well, the list of characters is sorted by ATASCII number, the idea is that you translate ATASCII $00 to UTF-8 "♥", $09 to UTF-8 "▗", $8F to "▜", etc.

 

The attached C program converts any ATASCII file in standard input to an UTF-8 encoded file at output, demonstrating the conversion (rename ".txty" to ".c", as I could not upload the ".c" file directly).

conv-atascii-utf8.c.txt

  • Like 1
Link to comment
Share on other sites

Hi!

 

 

Well, the list of characters is sorted by ATASCII number, the idea is that you translate ATASCII $00 to UTF-8 "♥", $09 to UTF-8 "▗", $8F to "▜", etc.

 

The attached C program converts any ATASCII file in standard input to an UTF-8 encoded file at output, demonstrating the conversion (rename ".txty" to ".c", as I could not upload the ".c" file directly).

 

Thank you. I will look this over. Keep in mind, I haven't learned much about Unicode yet (other than the basics of what it is and why it exists) and I'm not a C programmer. That said, I have already started looking into Unicode info and know enough programming that hopefully the C code makes enough sense to me (eventually). ;-)

Link to comment
Share on other sites

  • 2 years later...

Thanks to user E474 for bringing an issue to my attention. He got an error when trying to use the nix script. After looking into it, Ironically the issue was that the script had DOS/Windows style line endings instead of Unix style ones. I must have been working in Windows when I put that out before, and forgot to change to nix style EOLs. I'm attaching an updated version where I made sure the script and all plain text files have Unix style EOLs.

 

aac_v1.1_nix_script_edition.tar

  • Like 1
Link to comment
Share on other sites

  • 3 years later...
  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...