sgreben / jp

dead simple terminal plots from JSON data. single binary, no dependencies. linux, osx, windows.
MIT License
1.32k stars 33 forks source link

Sending chart from CLI #25

Closed PavelKa closed 3 years ago

PavelKa commented 3 years ago

Hello, I'd like to use Your utility to send a simple chart via mail from a command line in Linux. But there are an unreadable bunch of chars ████████ in the received email, if I pipe result from jp to "mail -s ..." command although jp works perfectly in CLI.
Do You have any advice on how to send a chart via email from CLI, please?

sgreben commented 3 years ago

Hey! I'm pretty sure this is a matter of setting the correct encoding (utf-8, in this case) for the mail - have a look at the answers here: https://stackoverflow.com/questions/3120168/how-to-send-special-characters-via-mail-from-a-shell-script, in particular

mail -a "Content-Type: text/plain; charset=UTF-8"

looks promising :)

PavelKa commented 3 years ago

Thank's for Your prompt action, the proposed solution really helps...