KiTTY icon indicating copy to clipboard operation
KiTTY copied to clipboard

multi-byte utf-8 output sent to ansi printer to clipboard produces garbage

Open mgrant0 opened this issue 2 years ago • 0 comments

Set up KiTTY to send stdout to ansi printer as per http://www.9bis.net/kitty/index.html#!pages/StdoutToClipboard.md

Create the bash function as directed:

% function wcl {
  echo -ne '\e''[5i'
  cat $*
  echo -ne '\e''[4i'
  echo "Copied to Windows clipboard" 1>&2
}
% echo £500 | wcl
Copied to Windows clipboard

This is what I get when I paste into notepad:

£500

€100 pastes as €100

I tried piping the cat to iconv to convert it to something else like utf-16 but it's even worse. I tried several (definitely not all!) different encodings in iconv but I couldn't find one which was clean.

Any idea if this is an encoding issue?

mgrant0 avatar Jun 08 '23 08:06 mgrant0