Recent

Author Topic: ANSI and ASCII Editor file in pascal(or py)?  (Read 2849 times)

d-_-b

  • New Member
  • *
  • Posts: 48
ANSI and ASCII Editor file in pascal(or py)?
« on: April 12, 2020, 10:13:35 pm »
Hi

I wonder if there is any terminal wizard lurking on the forums? I have a artist using moebius ansi editor to create the picture you see on the left.

But if i use the below pascal or attache python code in the pic my result is what you see on the right.

What am i doing wrong? I'm using mobaxterm on win10 and stuff like cmatrix and pipes.sh renders correctly.

So how must i change my pascal code to get the ansi like output of moebius?

The medtricorder.ans file can be found here

Code: Pascal  [Select][+][-]
  1. program ansview;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. uses Process, SysUtils, Classes;
  6. var s: ansistring = '';
  7.   strs: TStringList;
  8. begin
  9.   strs := TStringList.Create;
  10.   try
  11.     strs.LoadFromFile('data/medtricorder.ans');
  12.     writeln(strs.text);
  13.     //if RunCommand('/bin/bash', ['-c', format('echo %s', [strs.text] ) ], s) then writeln(s)
  14.   finally
  15.     strs.free;
  16.   end;
  17. end.
  18.  
Code: Pascal  [Select][+][-]
  1. mov     ax,0013h
  2. int     10h
Denthor thanks for the vga programming tutorials | Download all tutorials

trev

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2032
  • Former Delphi 1-7, 10.2 user
Re: ANSI and ASCII Editor file in pascal(or py)?
« Reply #1 on: April 13, 2020, 03:31:33 am »
Character set/codepage issue? See here which may be of help.

 

TinyPortal © 2005-2018