Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANSI artworks don't display correctly #444

Closed
jcubic opened this issue Oct 15, 2018 · 4 comments
Closed

ANSI artworks don't display correctly #444

jcubic opened this issue Oct 15, 2018 · 4 comments

Comments

@jcubic
Copy link
Owner

jcubic commented Oct 15, 2018

Steps to reproduce

try to display any of .ans files from fuel using:

iconv -f CP437 -t UTF-8 < file.ans

you can use this php script:

<?php
if (isset($_GET['file'])) {
    echo shell_exec(sprintf("iconv -f CP437 -t UTF-8 < %s", $_GET['file']));
}
?>
@jcubic
Copy link
Owner Author

jcubic commented Oct 15, 2018

I've used trick to handle \n\x1b[1A (found in some ANSI artwork) that is using enter and the move the cursor up so I've just removed this string entirely. moving cursor will not work for other cases.

jcubic added a commit that referenced this issue Oct 15, 2018
@jcubic
Copy link
Owner Author

jcubic commented Oct 15, 2018

move forward was also simple just replace with N number of spaces.

@jcubic
Copy link
Owner Author

jcubic commented Oct 15, 2018

My code for handling [1A was actually wrong because the sequence was �[1A�[38C move up and right.

@jcubic
Copy link
Owner Author

jcubic commented Oct 16, 2018

Working ANSI artworks can be seen in this pen https://codepen.io/jcubic/pen/pxdxmN?editors=0010

@jcubic jcubic closed this as completed Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant