Legacy Support Options (16 colors & ASCII encoding)
See original GitHub issueTODO
- 16 colors mode (option
colors=2|16|256|true
,256
by default) - output encoding (option
encoding=
,utf-8
by default)
Details
First, let me say I love this app. It produces lovely results on the command line.
I run a telnet BBS and would love the ability to curl the output of wttr.in to an ANSI file, so that said ANSI file can be viewed by users on my BBS. However, two things are stopping me from doing that:
- The BBS software I’m using (Synchronet, and probably most others) has no support for 256 color ANSI escape codes used in wttr.in’s output. As far as I can tell, the BBS software only supports the legacy 16 color escape codes.
- The output encoding of wttr.in (I’m guessing) is strictly UTF-8, which also does not render properly in the BBS. While I can set curl’s encoding to ASCII, the line-drawing characters do not translate properly when using that option.
To try to illustrate both issues, I’ll use the command curl wttr.in/NYC?n -o sample.ans
to generate a sample ANS file. When viewing the resulting sample file in the ANSI editor PablowDraw, the attached screen is what displays.
If there were parameter options for both selecting either 16 or 256 color codes and selecting either ASCII or UTF-8 character encoding, that would produce great results that BBS sysops would love.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Legacy Support Options (16 colors & ASCII encoding) - - Bountysource
Legacy Support Options (16 colors & ASCII encoding)
Read more >ANSI escape code - Wikipedia
ANSI escape sequences are a standard for in-band signaling to control cursor location, color, font styling, and other options on video ... Other...
Read more >Formatting codes - Minecraft Wiki - Fandom
A book showing the possible formatting options with the character that performs them. Formatting codes (also known as color codes) add color and ......
Read more >CSS Color Module Level 4 - W3C
16 Default Style Rules; 17 Sample code for Color Conversions ... For legacy reasons, rgb() also supports a legacy color syntax that ...
Read more >List of encodings that Node.js supports - Stack Overflow
When encoding a Buffer to a string, this encoding will omit padding. hex : Encode each byte as two hexadecimal characters. Legacy Character...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, I think both are doable. I updated the issue description, added both feature requests to it.
It will be possible to specify these two parameters with the following options:
encoding=
colors=
Nice, thank you!
Of the issues listed in your ASCII Only option, issue #432 is doable, as it’s most similar to what I’m asking for, however it seemingly does not ask to keep support for the box and line drawing characters within Codepage 437, which make ANSI tables look very nice.
(side note: we should be careful to not conflate plain-text discussed in issues #113 and #197 with ASCII encoding; ASCII != plain-text)
The frameless display could be a decent workaround, but there are other characters that would still get interpreted incorrectly, like the degree and wind direction symbols, as well occasional dashes used for the sun’s rays (another screenshot attached).
Specifying the encoding sounds ideal, if it’s doable.