Jump to content

Photo

AAC (ASCII ATASCII Converter) for our modern computers

ASCII ATASCII conversion Windows Linux OS-X Python

21 replies to this topic

#1 fujidude OFFLINE  

fujidude

    Quadrunner

  • 5,101 posts
  • Location:United States of America

Posted Tue Nov 3, 2015 7:36 PM

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, Tue Nov 3, 2015 7:39 PM.


#2 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Sat Nov 7, 2015 2:07 AM

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.

Attached Files



#3 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Sat Nov 7, 2015 1:21 PM

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, Sat Nov 7, 2015 1:29 PM.


#4 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Sun Nov 8, 2015 1:18 AM

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, Sun Nov 8, 2015 1:19 AM.


#5 snicklin OFFLINE  

snicklin

    River Patroller

  • 2,147 posts
  • Location:Australia

Posted Sun Nov 8, 2015 2:42 AM

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



#6 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Tue Nov 10, 2015 10:41 AM

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.



#7 rdea6 OFFLINE  

rdea6

    River Patroller

  • 2,745 posts
  • Location:Arizona USA

Posted Tue Nov 10, 2015 12:10 PM

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..



#8 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 13,936 posts
  • Location:United Kingdom

Posted Tue Nov 10, 2015 1:39 PM

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. :)

#9 Madi OFFLINE  

Madi

    Moonsweeper

  • 383 posts

Posted Tue Nov 10, 2015 2:40 PM

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.

 

aac.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

Attached Files

  • Attached File  aac.rar   10.13KB   134 downloads


#10 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Tue Nov 10, 2015 8:00 PM

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.



#11 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Tue Nov 10, 2015 8:21 PM

@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...i/Code_page_437

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

 

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


Edited by fujidude, Tue Nov 10, 2015 8:24 PM.


#12 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Tue Nov 10, 2015 8:36 PM

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).



#13 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Thu Nov 12, 2015 2:10 PM

@Madi: I checked out your files and it is as I understood from your written description.  Only characters in common are translated so the behavior is expected.



#14 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Thu Nov 26, 2015 6:16 PM

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.



#15 dmsc OFFLINE  

dmsc

    Moonsweeper

  • 441 posts
  • Location:Viña del Mar, Chile

Posted Thu Nov 26, 2015 8:40 PM

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.

Attached Files


Edited by dmsc, Thu Nov 26, 2015 8:44 PM.


#16 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Thu Nov 26, 2015 11:31 PM

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.



#17 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Thu Nov 26, 2015 11:54 PM

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.



#18 slx OFFLINE  

slx

    Stargunner

  • 1,567 posts
  • Location:Vienna, Austria

Posted Fri Nov 27, 2015 6:17 AM

Thanks for the effort!


Gesendet von meinem iPhone mit Tapatalk

#19 dmsc OFFLINE  

dmsc

    Moonsweeper

  • 441 posts
  • Location:Viña del Mar, Chile

Posted Fri Nov 27, 2015 4:17 PM

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).

Attached Files



#20 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Fri Nov 27, 2015 7:14 PM

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).  ;-)



#21 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Fri Nov 27, 2015 7:22 PM

Okay... here is v1.1 again, with corrected info.  References to working with Python 2.7 are removed.

 

Attached File  aac_v1.1_nix_script_edition.tar   190KB   128 downloads

Attached File  aac_v1.1_win32_extractor.exe.txt   4.63MB   143 downloads

Attached File  aac_v1.1_win64_extractor.exe.txt   4.98MB   138 downloads



#22 fujidude OFFLINE  

fujidude

    Quadrunner

  • Topic Starter
  • 5,101 posts
  • Location:United States of America

Posted Sat Oct 13, 2018 10:25 AM

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.

 

Attached File  aac_v1.1_nix_script_edition.tar   190KB   6 downloads







Also tagged with one or more of these keywords: ASCII, ATASCII, conversion, Windows, Linux, OS-X, Python

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users