How do I print "special" characters?

22 views
Skip to first unread message

BC

unread,
Oct 4, 2015, 9:42:22 AM10/4/15
to vim_use
When I do :hardcopy my printout is turning characters that appear correctly in the editor into gibberish. These are accented characters in Spanish words, and also fancy quotation marks and apostrophes (which I normally don't use but I was printing material that I'd pasted in from a word document) How can I fix this?

Nikolay Pavlov

unread,
Oct 4, 2015, 10:29:16 AM10/4/15
to vim...@googlegroups.com
2015-10-04 16:42 GMT+03:00 BC <bruce.a...@gmail.com>:
> When I do :hardcopy my printout is turning characters that appear correctly in the editor into gibberish. These are accented characters in Spanish words, and also fancy quotation marks and apostrophes (which I normally don't use but I was printing material that I'd pasted in from a word document) How can I fix this?

See :h 'printencoding': it is only possible if there is an encoding
file $VIMRUNTIME/print/{encoding}.ps with encoding which contains all
of the characters you want to print (you must set printencoding option
to this encoding name before printing) and this directory contains
only single-byte encodings AFAIK. It is probably better to use either
formatvim or tohtml Vim plugin to convert your file to something
highlighted (specifically formatvim supports LaTeX and HTML (and
anything else, but only if you are willing to write the backend),
tohtml supports only HTML), and then print the result.

>
> --
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups "vim_use" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Bruce Armstrong

unread,
Oct 4, 2015, 9:35:26 PM10/4/15
to vim...@googlegroups.com
Thanks Nikolay. I'll try tohtml. I don't understand the printencoding situation. When I try to check :set printencoding I get "E519: Option not supported: printencoding" 

You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/6JIqpLiIi34/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.

Tony Mechelynck

unread,
Oct 4, 2015, 10:30:21 PM10/4/15
to vim...@googlegroups.com
On Mon, Oct 5, 2015 at 3:34 AM, Bruce Armstrong
<bruce.a...@gmail.com> wrote:
> Thanks Nikolay. I'll try tohtml. I don't understand the printencoding
> situation. When I try to check :set printencoding I get "E519: Option not
> supported: printencoding"

According to the help, 'printencoding' requires both +printer and
+postscript to be compiled-in. You may want to check the output of the
:version command to see which one(s) you have (if any).

:ToHTML will of course produce an HTML file. To output it as something
other than HTML source you will have to open it in a browser (any
modern browser should do) then use the print function from there
("File → Print…" or similar).

Best regards,
Tony.
Reply all
Reply to author
Forward
0 new messages