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

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

Open
mgrant0 opened this issue Jun 8, 2023 · 0 comments

Comments

@mgrant0
Copy link

mgrant0 commented Jun 8, 2023

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?

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