utf8clip 1.0.0

dotnet tool install --global utf8clip --version 1.0.0
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local utf8clip --version 1.0.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=utf8clip&version=1.0.0
nuke :add-package utf8clip --version 1.0.0

Replacement for clip.exe in Windows that supports both read from/write to clipboard and uses UTF-8 encoding by default.

Works well with PowerShell Core or console programs that explicitly output UTF-8 text.

Usage

If started with file/piped input:

  • Copies the input, interpreted as UTF-8 text†, to the Windows clipboard.

Otherwise:

  • Prints the contents of the Windows clipboard to output as UTF-8 text.

†If there is a byte-order mark in the input it will be respected, e.g. for UTF-16 encoded files.

Examples

Copy program output to clipboard

<program> | utf8clip

Places a copy of the UTF-8 output from <program> on to the Windows clipboard.

Note that most native Windows commands like dir do not write UTF-8 output unless the console codepage is changed with chcp.

Copy file content to clipboard

utf8clip < README.md

Places a copy of the text from README.md on to the Windows clipboard.

Write clipboard content to console

utf8clip

Writes the current contents of the Windows clipboard to the console.

PowerShell Core Examples

Copy program output to clipboard

ls | utf8clip

Places a copy of the current directory listing on to the Windows clipboard.

This works correctly as PowerShell Core uses UTF-8 output by default.

Copy file content to clipboard

cat .\README.md | utf8clip

Places a copy of the text from README.md on to the Windows clipboard.

Write clipboard content to console

utf8clip

Writes the current contents of the Windows clipboard to the console.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.0.0 749 10/2/2019